[FFmpeg-devel] [PATCH] avformat/matroskadec: Fix cluster parsing loop which gathers seek information

Michael Niedermayer michaelni at gmx.at
Wed Oct 22 14:39:05 CEST 2014


On Wed, Oct 22, 2014 at 06:09:10AM -0500, Rodger Combs wrote:
> 
> > On Oct 21, 2014, at 21:38, Michael Niedermayer <michaelni at gmx.at> wrote:
> > 
> > Fixes Ticket2263
> > Fixes Ticket3934
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavformat/matroskadec.c |    4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index b742319..2ef3222 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -2921,11 +2921,11 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
> >         goto err;
> >     timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
> > 
> > -    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
> > +    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
> >         avio_seek(s->pb, st->index_entries[st->nb_index_entries - 1].pos,
> >                   SEEK_SET);
> >         matroska->current_id = 0;
> > -        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
> > +        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
> >             matroska_clear_queue(matroska);
> >             if (matroska_parse_cluster(matroska) < 0)
> >                 break;
> > -- 
> > 1.7.9.5
> > 
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> 
> Looks good to me, and does fix the problem for my files.

applied

thanks

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141022/f65b4bd6/attachment.asc>


More information about the ffmpeg-devel mailing list