From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 816AC4AA5E for ; Fri, 7 Jun 2024 09:11:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DB07B68D775; Fri, 7 Jun 2024 12:11:58 +0300 (EEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9655D68D3D0 for ; Fri, 7 Jun 2024 12:11:52 +0300 (EEST) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5295eb47b48so2367326e87.1 for ; Fri, 07 Jun 2024 02:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1717751512; x=1718356312; darn=ffmpeg.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=r/Fo1AQlWgKMqy+8eVydsiuQ7XcNrim/2P6LTlXPiX8=; b=oTmYzkapEZLQzRB7fFfyL7tK7UNYxqmiXwFeo4f/vf1+tGdUlmqYBJkk3UBmQCgpvq q+xXflDmgHfPVp0MqAxFm8MN9OX4DperIl2Gtquy3Hm9wONNfp7MujN5DcfJfyW17Knl o7N2D6O7yiRWLxFt6seH/SvwncnpFFBpWqVTYlJlY5eg9gFIGF+nQom4cmAaS4BgaGDx vJojTQkNqTl86msQV5Yt82PNFsYVygvgoX8YCllmnkD2vmVcu0/z9MtPB8jKsw51SR/b 8caOJK83SQS69yvExRCDELO05XCm0seFhyTmWOmXRxuDM6gzROBk4F7iLyP41+7o6Zm9 gxTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717751512; x=1718356312; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r/Fo1AQlWgKMqy+8eVydsiuQ7XcNrim/2P6LTlXPiX8=; b=AaWbQo00IUhnDxYyY+4X7fQfA9cCDTMjCer4EHINom2JW1NHAx61iyOzwOnzPAi0sp O39vCGj9AlGWsYD9/x+m8BITCRFAJUuceimWSk1o3k0vp+yzKaSo23OL83r1J5z+u+Za jKyc/9KPu9m3TN6G1gxN47Zy4uF+SB+uXnPkd83as3wtbD0jfGgk3bN+MYmrAGRE/ipv 1NT3yl7YTAanAygz5bNbA2wHmtzgDYBT8CD1oW+C8+pWVOkiMozUs0uOlA6r8vz7+OsY s//6Ay3p+Ivze4cs97RbMsqI6YhGGiu68ku5wIPlFb2pduwpseuOb2kFQouxWdfW0o9n XQMg== X-Gm-Message-State: AOJu0YzFG/O7mTtw4AvjEZv+sEpuHOMGxeOjFZ0J7ibQoVar8OIZQmZQ G+Grd/NkcEQJikZKb838IHXnje1x4E6QeL4YuV3+rK4t6sF1S44uvxEjb9bAaBqs2dpioso1ujn qeg== X-Google-Smtp-Source: AGHT+IFChrLP/3sGW+xgu42cltePdgmaPBHlsyqzOpKRp7e2R3azM3y2ZWZU/0ZG17SvEXPgUwCeMw== X-Received: by 2002:a05:6512:202f:b0:52b:7c3a:423e with SMTP id 2adb3069b0e04-52bb9f7c802mr1066597e87.20.1717751511596; Fri, 07 Jun 2024 02:11:51 -0700 (PDT) Received: from tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net (tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:11::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb42164fesm460932e87.148.2024.06.07.02.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:11:51 -0700 (PDT) Date: Fri, 7 Jun 2024 12:11:50 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: <20240606172018.1514-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2 2/4] avutil/timer: Add clock_gettime as a fallback of AV_READ_TIME X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 7 Jun 2024, Zhao Zhili wrote: > From: Zhao Zhili > > --- > libavutil/timer.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/libavutil/timer.h b/libavutil/timer.h > index 2cd299eca3..74c4d84e69 100644 > --- a/libavutil/timer.h > +++ b/libavutil/timer.h > @@ -46,6 +46,8 @@ > #include "macos_kperf.h" > #elif HAVE_MACH_ABSOLUTE_TIME > #include > +#elif HAVE_CLOCK_GETTIME > +#include > #endif > > #include "common.h" > @@ -70,6 +72,9 @@ > # define AV_READ_TIME gethrtime > # elif HAVE_MACH_ABSOLUTE_TIME > # define AV_READ_TIME mach_absolute_time > +# elif HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) > +# include "libavutil/time.h" > +# define AV_READ_TIME av_gettime_relative > # endif > #endif > > -- > 2.34.1 This looks reasonable to me. Although, the raw clock_gettime function, which gives nanosecond values (although maybe not actual nanosecond precision) probably could have more precision than av_gettime_relative which scales the values down to microseconds. // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".