[FFmpeg-cvslog] r20766 - trunk/ffmpeg.c

michael subversion
Tue Dec 8 15:10:49 CET 2009


Author: michael
Date: Tue Dec  8 15:10:49 2009
New Revision: 20766

Log:
Do not assume that av_get_bits_per_sample() is a multiple of 8.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Tue Dec  8 13:34:08 2009	(r20765)
+++ trunk/ffmpeg.c	Tue Dec  8 15:10:49 2009	(r20766)
@@ -717,7 +717,7 @@ static void do_audio_out(AVFormatContext
         }
     } else {
         AVPacket pkt;
-        int coded_bps = av_get_bits_per_sample(enc->codec->id)/8;
+        int coded_bps = av_get_bits_per_sample(enc->codec->id);
         av_init_packet(&pkt);
 
         ost->sync_opts += size_out / (osize * enc->channels);
@@ -726,7 +726,7 @@ static void do_audio_out(AVFormatContext
         /* determine the size of the coded buffer */
         size_out /= osize;
         if (coded_bps)
-            size_out *= coded_bps;
+            size_out = size_out*coded_bps/8;
 
         //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
         ret = avcodec_encode_audio(enc, audio_out, size_out,



More information about the ffmpeg-cvslog mailing list