diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-02-26 21:42:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 01:52:51 +0100 |
commit | 29e435ca3381284297f8fed6f181ef14bb767e08 (patch) | |
tree | 593309ad666c0a62cb79f31acdc80e35f7d15b41 /libavformat | |
parent | 0540d5c5fc1b573cac86c641c338ec1cb7a5e8ea (diff) | |
download | ffmpeg-29e435ca3381284297f8fed6f181ef14bb767e08.tar.gz |
avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0b8640f75ff7569c98d6fdb03d83451104e088c)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/bit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c index 5d05da0f81..138d2feadb 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -119,8 +119,12 @@ static int write_header(AVFormatContext *s) { AVCodecContext *enc = s->streams[0]->codec; - enc->codec_id = AV_CODEC_ID_G729; - enc->channels = 1; + if ((enc->codec_id != AV_CODEC_ID_G729) || enc->channels != 1) { + av_log(s, AV_LOG_ERROR, + "only codec g729 with 1 channel is supported by this format\n"); + return AVERROR(EINVAL); + } + enc->bits_per_coded_sample = 16; enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3; |