[FFmpeg-devel] [PATCH] avformat/demux: Remove dead stores

Michael Niedermayer michael at niedermayer.cc
Tue May 28 02:38:05 EEST 2024


On Fri, May 24, 2024 at 10:52:02PM +0200, Michael Niedermayer wrote:
> On Fri, May 24, 2024 at 08:21:05AM +0200, Andreas Rheinhardt wrote:
> > Michael Niedermayer:
> > > Fixes: CID1473512 Unused value
> > > Fixes: CID1529228 Unused value
> > > 
> > > Sponsored-by: Sovereign Tech Fund
> > > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > > ---
> > >  libavformat/demux.c | 5 -----
> > >  1 file changed, 5 deletions(-)
> > > 
> > > diff --git a/libavformat/demux.c b/libavformat/demux.c
> > > index ecefe7e0a74..d0a5a39d052 100644
> > > --- a/libavformat/demux.c
> > > +++ b/libavformat/demux.c
> > > @@ -2998,9 +2998,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> > >  
> > >      av_opt_set_int(ic, "skip_clear", 0, AV_OPT_SEARCH_CHILDREN);
> > >  
> > > -    if (ret >= 0 && ic->nb_streams)
> > > -        /* We could not have all the codec parameters before EOF. */
> > > -        ret = -1;
> > >      for (unsigned i = 0; i < ic->nb_streams; i++) {
> > >          AVStream *const st  = ic->streams[i];
> > >          FFStream *const sti = ffstream(st);
> > > @@ -3022,8 +3019,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> > >                     "Could not find codec parameters for stream %d (%s): %s\n"
> > >                     "Consider increasing the value for the 'analyzeduration' (%"PRId64") and 'probesize' (%"PRId64") options\n",
> > >                     i, buf, errmsg, ic->max_analyze_duration, ic->probesize);
> > > -        } else {
> > > -            ret = 0;
> > >          }
> > >      }
> > >  
> > 
> > IIRC these stores are only dead since
> > ac5a568e6dff8162a2e982f3571b925f1b207e2c; and it doesn't seem as if this
> > was intended.
> 
> replaced by:
> 
> @@ -3027,9 +3027,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
>          }
>      }
> 
> -    ret = compute_chapters_end(ic);
> -    if (ret < 0)
> +    err = compute_chapters_end(ic);
> +    if (err < 0) {
> +        ret = err;
>          goto find_stream_info_err;
> +    }
> 
>      /* update the stream parameters from the internal codec contexts */
>      for (unsigned i = 0; i < ic->nb_streams; i++) {
> 

will apply this modified variant

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240528/9a169ed2/attachment.sig>


More information about the ffmpeg-devel mailing list