[FFmpeg-devel] [PATCH] avformat/mov: Do not use reference stream in mov_read_sidx() if there is no reference stream

Michael Niedermayer michaelni at gmx.at
Thu Feb 14 16:30:25 EET 2019


On Wed, Feb 13, 2019 at 12:16:36PM +0000, Derek Buitenhuis wrote:
> On 12/02/2019 22:28, Michael Niedermayer wrote:
> > @@ -5048,7 +5048,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> >          for (i = 0; i < c->fc->nb_streams; i++) {
> >              st = c->fc->streams[i];
> >              sc = st->priv_data;
> > -            if (!sc->has_sidx) {
> > +            if (ref_st && !sc->has_sidx) {
> >                  st->duration = sc->track_end = av_rescale(ref_st->duration, sc->time_scale, ref_sc->time_scale);
> >              }
> >          }
> 
> Is it perhaps better to not run this loop at all if ref_sc or ref_st do not exist?

will commit with the check moved to the loop

thanks

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2

-------------- 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/20190214/accbc53c/attachment.sig>


More information about the ffmpeg-devel mailing list