summaryrefslogtreecommitdiff
path: root/libavcodec/g726.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-22 13:26:14 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-01 11:29:16 -0400
commite00eb03cd8bfb6993d33c30ccd560947b5f6bad5 (patch)
treea9fda13432f3bb8c5cc78e3c58c4fe42a90142f2 /libavcodec/g726.c
parent99d868635725e3b85a5c549e6bb0e97e10cf5248 (diff)
downloadffmpeg-e00eb03cd8bfb6993d33c30ccd560947b5f6bad5.tar.gz
g726dec: set channel layout at initialization instead of validating it
Diffstat (limited to 'libavcodec/g726.c')
-rw-r--r--libavcodec/g726.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 7fa2be3e99..ed4bd26c70 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) {