Commit d0b8640f authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

avformat/bit: only accept the g729 codec and 1 channel

Other codecs/channel numbers are not supported by this muxer.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent eeda2c3d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment