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 589ED4294F for ; Mon, 10 Jan 2022 10:19:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 232EB68AE10; Mon, 10 Jan 2022 12:19:03 +0200 (EET) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0164068008D for ; Mon, 10 Jan 2022 12:18:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1641809925; bh=aFPM//urYffrpOcPn6P5mXHLYN7sticEPzqB501xiCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CB35GkVchwUzRx/PRzgPzJXHbcUCUGoY4JFk/10f4VSdNtqhT5r1V9dlQpewkntIY 0wrgvVTNEsu3SnrtVIIzlV5RadqBc8IYotNS+VpeBS3qKEYdV3Xb2SvvYcAXQx64kx YFL10ZJFWzynUpXNnWzYw8RoD+lkSWJj0TvNGx+w= Received: from ZHILIZHAO-MB2.tencent.com ([113.108.77.69]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 4AC29688; Mon, 10 Jan 2022 18:18:44 +0800 X-QQ-mid: xmsmtpt1641809924t6j1njljl Message-ID: X-QQ-XMAILINFO: Nip6yC9MT+XlngvNkmC/AvDgG1NI00BKnOV/Ryt9rPMHcwgI8l4vIPFJmALOlm O+iufCQ1KUjalVhDwRj92SL/pOw/EplZvrZxuVXHZ3ThfNlVY8C6jepdXzdiLC9z3lHNyVqzz3f/ u7woIgFZLjGYfnlk7UzV/kFmJoh6aDuUyPa4WsGgMRGH7x04q2EpZYgNn6u5CNa4jsl2MZNrty78 LUin1HiUa+zS4f23azSZseP6MIfgvi+Nnd68W9Jx8gzcD95ZES+tkl+BFJHNWu8gAU3qWkzQsjF1 W5n7yghMSIUHy2SBdu85R+JnOakYGP0Ih+LRbqPdifcwpuQOoY1f8sK3QzbFI7c4F2UdWK4SqLgL wQt9/bSin9MYSHR5lUb/NYt4R9zsd4179V+2PWgP9t+3lB5dK8f9IF9UV9PUPcOKJGMK+qCrm8DH I3vmow6cZ7k9vv+E0Q8WXX/0gyhlRWm/a1nZFpyhU/6YZ28eg/IuGGdPt1chtsOdZHNPFd8f0GZa I9TKDU+H2iVqw84GPjzBVz4xwBjshyW9IK4lholreDh+r04iNXw08MNlIjK8wHQOg/Ai13n7Ezqv 96eY5jYx6RATKQRWHzfbTUzpSWaV5KXaJZ2seZX3eqa7TnwG5xXpWQpD19o9XFlJmkKdQG63V1VJ MjPbNssBNkG/dF0EGVM4l7uu4yx7RtCJ2j4jIcwnq2lqcrEpdYqgh33d2IVBn1sDxl9TRvywhrYx H02M1DSMOilQJj28EUytzWe9Liur08hUCzcd3icbjxT0JoKIH2i1LZAMLIAy31WKbYSkTn0ao4FF ejazjxmy13Z/hQ+GwyF2vWN7ZlhmX0mo5c3WOSN+EFAil9zuT2pdky6Bxv+adkgb3/aXPog1kWrg == From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Jan 2022 18:18:44 +0800 X-OQ-MSGID: <20220110101844.59119-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4] avformat/movenc: fix duration in mdhd box 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-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: mvhd and tkhd present the post-editlist duration, while mdhd should have the pre-editlist duration. Regression since c2424b1f3. --- v4: fix more fate libavformat/movenc.c | 2 +- tests/ref/fate/copy-trac3074 | 2 +- tests/ref/fate/mov-cover-image | 2 +- tests/ref/fate/mov-mp4-disposition-mpegts-remux | 2 +- tests/ref/fate/movenc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index ab33371296..4c868919ae 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2960,7 +2960,7 @@ static int64_t calc_pts_duration(MOVMuxContext *mov, MOVTrack *track) static int mov_write_mdhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { - int64_t duration = calc_pts_duration(mov, track); + int64_t duration = calc_samples_pts_duration(mov, track); int version = duration < INT32_MAX ? 0 : 1; if (track->mode == MODE_ISM) diff --git a/tests/ref/fate/copy-trac3074 b/tests/ref/fate/copy-trac3074 index 4748296c2a..2ef7e702cd 100644 --- a/tests/ref/fate/copy-trac3074 +++ b/tests/ref/fate/copy-trac3074 @@ -1,4 +1,4 @@ -452d91e7c6889b787717fef25b6fce43 *tests/data/fate/copy-trac3074.mp4 +36fcc0a62695bcf93068fcfe68283ee9 *tests/data/fate/copy-trac3074.mp4 334016 tests/data/fate/copy-trac3074.mp4 #tb 0: 1/48000 #media_type 0: audio diff --git a/tests/ref/fate/mov-cover-image b/tests/ref/fate/mov-cover-image index 680d84e061..6141646afa 100644 --- a/tests/ref/fate/mov-cover-image +++ b/tests/ref/fate/mov-cover-image @@ -1,4 +1,4 @@ -4e92f776010bd7a727c11bf8c34cde1e *tests/data/fate/mov-cover-image.mp4 +54a8870d5d1e6cc4da28ae422aa70898 *tests/data/fate/mov-cover-image.mp4 1011919 tests/data/fate/mov-cover-image.mp4 #extradata 0: 2, 0x00340022 #tb 0: 1/44100 diff --git a/tests/ref/fate/mov-mp4-disposition-mpegts-remux b/tests/ref/fate/mov-mp4-disposition-mpegts-remux index 78f1668f65..184b952e04 100644 --- a/tests/ref/fate/mov-mp4-disposition-mpegts-remux +++ b/tests/ref/fate/mov-mp4-disposition-mpegts-remux @@ -1,4 +1,4 @@ -3c4432fe59ffd9f2ed6ba4b122cea935 *tests/data/fate/mov-mp4-disposition-mpegts-remux.mp4 +adb3b95c07a5f3e0c86641dd62f01dae *tests/data/fate/mov-mp4-disposition-mpegts-remux.mp4 5709 tests/data/fate/mov-mp4-disposition-mpegts-remux.mp4 #tb 0: 1/48000 #media_type 0: audio diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc index 81ea75f372..19e4e291b8 100644 --- a/tests/ref/fate/movenc +++ b/tests/ref/fate/movenc @@ -7,7 +7,7 @@ write_data len 36, time nopts, type header atom ftyp write_data len 2761, time nopts, type header atom - write_data len 908, time 966667, type sync atom moof write_data len 110, time nopts, type trailer atom - -caf0876986b5f033efc0958c338289cc 3815 non-empty-moov-elst +9d260d424e9de4626163fd25ccce5bab 3815 non-empty-moov-elst write_data len 36, time nopts, type header atom ftyp write_data len 2669, time nopts, type header atom - write_data len 908, time 1000000, type sync atom moof -- 2.31.1 _______________________________________________ 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".