mirror of https://github.com/mpv-player/mpv
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:
parent
2df43c4b2f
commit
0d8f9453b5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue