[FFmpeg-devel] [PATCH] mov: Properly abide by the track's media duration

Michael Niedermayer michael at niedermayer.cc
Thu Apr 19 00:35:38 EEST 2018


On Tue, Apr 17, 2018 at 08:59:48PM +0100, Derek Buitenhuis wrote:
> The track's media duration from the mdhd atom takes precedence
> over both the stts and elst atom for calculating and setting
> the track's total duraion.
> 
> Technically, we shouldn't be using the stts atom at all for
> calculating stream durations.
> 
> This fixes incorrect stream and final packet durations on files
> with edit lists that are longer than the media duration.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
> Personally I'd have removed the incorrect setting of the stream
> duration in the stts reading code...
> ---
>  libavformat/mov.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

This breaks fate: (have not tested anything beyond this)

TEST    adtstoasc_ticket3715
--- ./tests/ref/fate/adtstoasc_ticket3715	2018-04-17 14:20:30.500366780 +0200
+++ tests/data/fate/adtstoasc_ticket3715	2018-04-18 23:34:00.751854625 +0200
@@ -92,4 +92,4 @@
 0,      83968,      83968,     1024,      465, 0xeb3ce0af
 0,      84992,      84992,     1024,      326, 0x7be4a667
 0,      86016,      86016,     1024,      339, 0x2cf4a71f
-0,      87040,      87040,     1028,      258, 0xd4007ad4
+0,      87040,      87040,     1024,      258, 0xd4007ad4
Test adtstoasc_ticket3715 failed. Look at tests/data/fate/adtstoasc_ticket3715.err for details.
make: *** [fate-adtstoasc_ticket3715] Error 1

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180418/1306b559/attachment.sig>


More information about the ffmpeg-devel mailing list