changeset 684:d7c7f7bbdf55 libavformat

proper handling of samplesize
author alex
date Fri, 25 Feb 2005 11:15:12 +0000
parents 095009fc2f35
children 4b339414d338
files flvdec.c flvenc.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flvdec.c	Thu Feb 24 19:08:50 2005 +0000
+++ b/flvdec.c	Fri Feb 25 11:15:12 2005 +0000
@@ -132,6 +132,7 @@
     		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;
--- a/flvenc.c	Thu Feb 24 19:08:50 2005 +0000
+++ b/flvenc.c	Fri Feb 25 11:15:12 2005 +0000
@@ -35,7 +35,7 @@
 }
 
 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: