[MPlayer-cvslog] r20768 - trunk/libmpcodecs/dec_audio.c

uau subversion at mplayerhq.hu
Wed Nov 8 00:16:55 CET 2006


Author: uau
Date: Wed Nov  8 00:16:55 2006
New Revision: 20768

Modified:
   trunk/libmpcodecs/dec_audio.c

Log:
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.


Modified: trunk/libmpcodecs/dec_audio.c
==============================================================================
--- trunk/libmpcodecs/dec_audio.c	(original)
+++ trunk/libmpcodecs/dec_audio.c	Wed Nov  8 00:16:55 2006
@@ -415,7 +415,8 @@
   
   // 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



More information about the MPlayer-cvslog mailing list