]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegaudiodec.c
merge read and and in add_paeth_prediction
[ffmpeg] / libavcodec / mpegaudiodec.c
index 0cd0b688c187ca9584aa684ebf327d99a0894c94..5d420dca3e93d034c55db34be4b82f6d6e0bd308 100644 (file)
@@ -24,6 +24,7 @@
  * MPEG Audio decoder.
  */
 
+#include "libavutil/audioconvert.h"
 #include "avcodec.h"
 #include "get_bits.h"
 #include "dsputil.h"
@@ -2054,6 +2055,7 @@ static int decode_frame(AVCodecContext * avctx,
     }
     /* update codec info */
     avctx->channels = s->nb_channels;
+    avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
     if (!avctx->bit_rate)
         avctx->bit_rate = s->bit_rate;
     avctx->sub_id = s->layer;
@@ -2227,8 +2229,7 @@ static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
     int i;
 
     for (i = 0; i < s->frames; i++)
-        if (s->mp3decctx[i])
-            av_free(s->mp3decctx[i]);
+        av_free(s->mp3decctx[i]);
 
     return 0;
 }