[FFmpeg-devel] [PATCH] flvdec: remove dead code.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Dec 3 19:04:46 CET 2011


On Sat, Dec 03, 2011 at 06:55:50PM +0100, Michael Niedermayer wrote:
> On Sat, Dec 03, 2011 at 06:00:31PM +0100, Reimar Döffinger wrote:
> > Probably the code should just be fixed, however I do not have
> > a sample to figure out how it would be correct.
> > 
> > Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> > ---
> >  libavformat/flvdec.c |    3 ---
> >  1 files changed, 0 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> > index 65c30da..428f1fc 100644
> > --- a/libavformat/flvdec.c
> > +++ b/libavformat/flvdec.c
> > @@ -313,9 +313,6 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
> >              snprintf(str_val, sizeof(str_val), "%.f", num_val);
> >              av_dict_set(&s->metadata, key, str_val, 0);
> >          } else if(amf_type == AMF_DATA_TYPE_OBJECT){
> > -            if(s->nb_streams==1 && ((!acodec && !strcmp(key, "audiocodecid")) || (!vcodec && !strcmp(key, "videocodecid")))){
> > -                s->ctx_flags &= ~AVFMTCTX_NOHEADER; //If there is either audio/video missing, codecid will be an empty object
> > -            }
> 
> I suspect its only needed to move this up before the big if 
> that stops audiocodecid from reaching this

The thing that irritates me is that the reason that if is needed
is because the type is NUM, but this check is for OBJECT.
And the comment speaks about "empty object" but never checks for
the "empty" part.
So the code simply makes no sense at all to me and thus I am
a bit unsure about changing it without a testcase.


More information about the ffmpeg-devel mailing list