[FFmpeg-user] duplicate branch for if else statement

Ruoyu liangry at ucweb.com
Sat Oct 11 13:59:52 CEST 2014


Hi,

Duplicate branches for if and else is found in libavformat/sol.c, at 
line 60-62.

static enum AVCodecID sol_codec_id(int magic, int type)
{
     if (magic == 0x0B8D)
     {
         if (type & SOL_DPCM) return AV_CODEC_ID_SOL_DPCM;
         else return AV_CODEC_ID_PCM_U8;
     }
     if (type & SOL_DPCM)
     {
         if (type & SOL_16BIT) return AV_CODEC_ID_SOL_DPCM;
         else if (magic == 0x0C8D) return AV_CODEC_ID_SOL_DPCM;
         else return AV_CODEC_ID_SOL_DPCM;
     }
     if (type & SOL_16BIT) return AV_CODEC_ID_PCM_S16LE;
     return AV_CODEC_ID_PCM_U8;
}

As you can see, all branches return AV_CODEC_ID_SOL_DPCM. Is it correct?




More information about the ffmpeg-user mailing list