diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index f9f4fbe40b..ba024aec38 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -132,6 +132,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4); st->codec.codec_tag= (flags >> 4); } + st->codec.bits_per_sample = (flags & 2) ? 16 : 8; } }else{ st->codec.codec_type = CODEC_TYPE_VIDEO; diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 500d4220d7..a9a8730ee7 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -35,7 +35,7 @@ static void put_be24(ByteIOContext *pb, int value) } static int get_audio_flags(AVCodecContext *enc){ - int flags = 0; + int flags = (enc->bits_per_sample == 16) ? 0x2 : 0x0; switch (enc->sample_rate) { case 44100: