From 2f5132e7a830a0057e8a17d6795b40879f815066 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 25 Feb 2005 11:15:12 +0000 Subject: [PATCH] proper handling of samplesize Originally committed as revision 3980 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/flvdec.c | 1 + libavformat/flvenc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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: