[FFmpeg-devel] [PATCH 1/2] mov: fix decode of fragments that overlap in time

Michael Niedermayer michael at niedermayer.cc
Wed Oct 4 13:50:43 EEST 2017


On Fri, Sep 29, 2017 at 08:54:08AM -0700, John Stebbins wrote:
> When keyframe intervals of dash segments are not perfectly aligned,
> fragments in the stream can overlap in time. Append new "trun" index
> entries to the end of the index instead of sorting by timestamp.
> Sorting by timestamp causes packets to be read out of decode order and
> results in decode errors.
> ---
>  libavformat/mov.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 899690d920..c7422cd9ed 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4340,8 +4340,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>                                    MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES));
>          if (keyframe)
>              distance = 0;
> -        ctts_index = av_add_index_entry(st, offset, dts, sample_size, distance,
> -                                        keyframe ? AVINDEX_KEYFRAME : 0);
> +        ctts_index = add_index_entry(st, offset, dts, sample_size, distance,
> +                                     keyframe ? AVINDEX_KEYFRAME : 0);

can this lead to timestamps being out of order not just changing
from strictly monotone to monotone ?

Maybe iam missing somehing but out of order could/would cause problems
with av_index_search_timestamp() and possibly others

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171004/f57d096d/attachment.sig>


More information about the ffmpeg-devel mailing list