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

Michael Niedermayer michaelni at gmx.at
Sat Dec 3 19:06:40 CET 2011


On Sat, Dec 03, 2011 at 07:04:46PM +0100, Reimar Döffinger wrote:
> 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.

asad, do you have a testcase ?

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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111203/506f0b87/attachment.asc>


More information about the ffmpeg-devel mailing list