Fix code that cuts audio data if the filters produce too much.

It incorrectly used the channel count and sample size values from the
decoder even though the filters can change those.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20768 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2006-11-07 23:16:55 +00:00
parent 2df43c4b2f
commit 0d8f9453b5
1 changed files with 2 additions and 1 deletions

View File

@ -415,7 +415,8 @@ int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
// copy filter==>out:
if(maxlen < pafd->len) {
maxlen -= maxlen % (sh_audio->channels * sh_audio->samplesize);
af_stream_t *afs = sh_audio->afilter;
maxlen -= maxlen % (afs->output.nch * afs->output.bps);
mp_msg(MSGT_DECAUDIO,MSGL_WARN,"%i bytes of audio data lost due to buffer overflow, len = %i\n", pafd->len - maxlen,pafd->len);
}
else