Commit 060b8592 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Originally committed as revision 20766 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b68a7679
...@@ -717,7 +717,7 @@ static void do_audio_out(AVFormatContext *s, ...@@ -717,7 +717,7 @@ static void do_audio_out(AVFormatContext *s,
} }
} else { } else {
AVPacket pkt; 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); av_init_packet(&pkt);
ost->sync_opts += size_out / (osize * enc->channels); ost->sync_opts += size_out / (osize * enc->channels);
...@@ -726,7 +726,7 @@ static void do_audio_out(AVFormatContext *s, ...@@ -726,7 +726,7 @@ static void do_audio_out(AVFormatContext *s,
/* determine the size of the coded buffer */ /* determine the size of the coded buffer */
size_out /= osize; size_out /= osize;
if (coded_bps) 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() //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
ret = avcodec_encode_audio(enc, audio_out, size_out, ret = avcodec_encode_audio(enc, audio_out, size_out,
......
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