diff libmpcodecs/dec_audio.c @ 11857:6107e58dcc28

not pretty, but at least it prevents the channels from getting out of order... the real solution is to get rid of libaf (probably the worst code in mplayer!) and replace it with a good audio layer...
author rfelker
date Tue, 27 Jan 2004 06:30:16 +0000
parents 27ba230ec5d4
children f191e76af463
line wrap: on
line diff
--- a/libmpcodecs/dec_audio.c	Tue Jan 27 06:02:29 2004 +0000
+++ b/libmpcodecs/dec_audio.c	Tue Jan 27 06:30:16 2004 +0000
@@ -438,8 +438,10 @@
       declen, pafd->len, maxlen);
   
   // copy filter==>out:
-  if(maxlen < pafd->len)
+  if(maxlen < pafd->len) {
+    maxlen -= maxlen % (sh_audio->channels * sh_audio->samplesize);
     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
     maxlen=pafd->len;
   memmove(buf, pafd->audio, maxlen);