]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libgsm.c
rtpenc_aac: Fix 10l bug
[ffmpeg] / libavcodec / libgsm.c
index 97f8abe10a51a529277ba244adadeb3ae0be6938..e90bdf0c4e85de002f719ed55aeceb7aa3eb089e 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <gsm/gsm.h>
 
+#include "libavutil/audioconvert.h"
 #include "avcodec.h"
 #include "internal.h"
 #include "gsm.h"
@@ -153,19 +154,11 @@ typedef struct LibGSMDecodeContext {
 static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
     LibGSMDecodeContext *s = avctx->priv_data;
 
-    if (avctx->channels > 1) {
-        av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
-               avctx->channels);
-        return -1;
-    }
-
-    if (!avctx->channels)
-        avctx->channels = 1;
-
+    avctx->channels       = 1;
+    avctx->channel_layout = AV_CH_LAYOUT_MONO;
     if (!avctx->sample_rate)
         avctx->sample_rate = 8000;
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
 
     s->state = gsm_create();