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 06BEB40807 for ; Thu, 27 Apr 2023 14:00:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 48BA568BF18; Thu, 27 Apr 2023 17:00:03 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB7F068B630 for ; Thu, 27 Apr 2023 16:59:56 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B30A12404EE for ; Thu, 27 Apr 2023 15:59:56 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 43gwsHX-HDot for ; Thu, 27 Apr 2023 15:59:56 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id DB5082404EC for ; Thu, 27 Apr 2023 15:59:55 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 8A1163A031B for ; Thu, 27 Apr 2023 15:59:55 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Apr 2023 15:59:30 +0200 Message-Id: <20230427135930.32333-1-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavf/dauddec: set timebase to 1/samplerate 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Prevents lavf from generating inexact timestamps with the default timebase of 1/90000. --- libavformat/dauddec.c | 4 ++++ tests/ref/fate/d-cinema-demux | 10 +++++----- tests/ref/fate/dcinema-encode | 26 +++++++++++++------------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/libavformat/dauddec.c b/libavformat/dauddec.c index 0cbf7e4e36..7e411091ec 100644 --- a/libavformat/dauddec.c +++ b/libavformat/dauddec.c @@ -21,6 +21,7 @@ #include "libavutil/channel_layout.h" #include "avformat.h" +#include "internal.h" static int daud_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); @@ -34,6 +35,9 @@ static int daud_header(AVFormatContext *s) { st->codecpar->bit_rate = 3 * 6 * 96000 * 8; st->codecpar->block_align = 3 * 6; st->codecpar->bits_per_coded_sample = 24; + + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + return 0; } diff --git a/tests/ref/fate/d-cinema-demux b/tests/ref/fate/d-cinema-demux index f1e8b5f755..e517c20e76 100644 --- a/tests/ref/fate/d-cinema-demux +++ b/tests/ref/fate/d-cinema-demux @@ -1,9 +1,9 @@ -#tb 0: 1/90000 +#tb 0: 1/96000 #media_type 0: audio #codec_id 0: pcm_s24daud #sample_rate 0: 96000 #channel_layout_name 0: 5.1(side) -0, 0, 0, 1875, 36000, 0xd592781d -0, 1875, 1875, 1875, 36000, 0xd592781d -0, 3750, 3750, 1875, 36000, 0xd592781d -0, 5625, 5625, 1200, 23056, 0xde81f0d6, F=0x3 +0, 0, 0, 2000, 36000, 0xd592781d +0, 2000, 2000, 2000, 36000, 0xd592781d +0, 4000, 4000, 2000, 36000, 0xd592781d +0, 6000, 6000, 1280, 23056, 0xde81f0d6, F=0x3 diff --git a/tests/ref/fate/dcinema-encode b/tests/ref/fate/dcinema-encode index 471820dbda..fabbc034f0 100644 --- a/tests/ref/fate/dcinema-encode +++ b/tests/ref/fate/dcinema-encode @@ -9,21 +9,21 @@ #stream#, dts, pts, duration, size, hash 0, 0, 0, 341, 4092, 697cddfcd0e21f24782af0705b7048f3 0, 341, 341, 341, 4092, a057b18cd493923fed33c18578f61e0b -0, 683, 683, 341, 4092, f4eacfd888566040067b8e5ce7d276c6 -0, 1024, 1024, 341, 4092, 4de78d332ce2047014880a110c160dc2 +0, 682, 682, 341, 4092, f4eacfd888566040067b8e5ce7d276c6 +0, 1023, 1023, 341, 4092, 4de78d332ce2047014880a110c160dc2 0, 1364, 1364, 341, 4092, 138ee3fc206538feca6de3d6d62d08eb -0, 1706, 1706, 341, 4092, 187a2f2998aa1c0ba0130c57dd1d6c86 -0, 2047, 2047, 341, 4092, 54e6c3db8a5f8c09b47f025659a36b17 +0, 1705, 1705, 341, 4092, 187a2f2998aa1c0ba0130c57dd1d6c86 +0, 2046, 2046, 341, 4092, 54e6c3db8a5f8c09b47f025659a36b17 0, 2387, 2387, 341, 4092, 8abfdf44a24c158429c71e01cee31e20 -0, 2729, 2729, 341, 4092, bd08f5018edc5dc4520739e913ed89a3 -0, 3070, 3070, 341, 4092, 9f60ba4275646344e4a9b3c647efffe9 -0, 3411, 3411, 341, 4092, 00cefc1f27230cdd06ecd43132e16327 +0, 2728, 2728, 341, 4092, bd08f5018edc5dc4520739e913ed89a3 +0, 3069, 3069, 341, 4092, 9f60ba4275646344e4a9b3c647efffe9 +0, 3410, 3410, 341, 4092, 00cefc1f27230cdd06ecd43132e16327 0, 3751, 3751, 341, 4092, d4d13047cd639ed722a4ae1bc1f06991 -0, 4093, 4093, 341, 4092, 16b227e4f968c11cba279506f00d5172 -0, 4434, 4434, 341, 4092, 70f4046f709fdd4d80e2f2ffc862f21a +0, 4092, 4092, 341, 4092, 16b227e4f968c11cba279506f00d5172 +0, 4433, 4433, 341, 4092, 70f4046f709fdd4d80e2f2ffc862f21a 0, 4774, 4774, 341, 4092, adbef4b4ef728f0c2a31b4b0baba50a0 -0, 5116, 5116, 341, 4092, fe009b6cc96b9d1098dcc5fba0e6b3fa -0, 5457, 5457, 341, 4092, 4462b2f1654c9b31fdd7ab04ffb84192 +0, 5115, 5115, 341, 4092, fe009b6cc96b9d1098dcc5fba0e6b3fa +0, 5456, 5456, 341, 4092, 4462b2f1654c9b31fdd7ab04ffb84192 0, 5797, 5797, 341, 4092, 2e96ba3bd13de03f9cfdc2b8c3ea0620 -0, 6139, 6139, 341, 4092, 395c920f10cce6670029a98095eba027 -0, 6480, 6480, 341, 4092, 28d4c2f6364f31cb61f4aa144badc734 +0, 6138, 6138, 341, 4092, 395c920f10cce6670029a98095eba027 +0, 6479, 6479, 341, 4092, 28d4c2f6364f31cb61f4aa144badc734 -- 2.39.2 _______________________________________________ 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".