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

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Feb 13 14:16:36 EET 2019


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?

- Derek


More information about the ffmpeg-devel mailing list