1
mirror of https://github.com/mpv-player/mpv synced 2024-07-31 16:29:58 +02:00

Avoid a division by 0 when using -oac mp3lame but no audio data actually is encoded.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28382 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-01-28 12:46:05 +00:00
parent 3788789408
commit 9c116d24e6

View File

@ -136,6 +136,7 @@ static void fixup(audio_encoder_t *encoder)
// fixup CBR mp3 audio header:
if(!lame_param_vbr) {
encoder->stream->h.dwSampleSize=1;
if (encoder->stream->h.dwLength)
((MPEGLAYER3WAVEFORMAT*)(encoder->stream->wf))->nBlockSize=
(encoder->stream->size+(encoder->stream->h.dwLength>>1))/encoder->stream->h.dwLength;
encoder->stream->h.dwLength=encoder->stream->size;