[FFmpeg-cvslog] g726dec: set channel layout at initialization instead of validating it

Justin Ruggles git at videolan.org
Fri Nov 2 14:32:40 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Oct 22 13:26:14 2012 -0400| [e00eb03cd8bfb6993d33c30ccd560947b5f6bad5] | committer: Justin Ruggles

g726dec: set channel layout at initialization instead of validating it

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e00eb03cd8bfb6993d33c30ccd560947b5f6bad5
---

 libavcodec/g726.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 7fa2be3..ed4bd26 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <limits.h>
+
+#include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
@@ -428,10 +430,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
         return AVERROR(EINVAL);
     }
 
-    if(avctx->channels != 1){
-        av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
-        return AVERROR(EINVAL);
-    }
+    avctx->channels       = 1;
+    avctx->channel_layout = AV_CH_LAYOUT_MONO;
 
     c->code_size = avctx->bits_per_coded_sample;
     if (c->code_size < 2 || c->code_size > 5) {



More information about the ffmpeg-cvslog mailing list