[Mplayer-cvslog] CVS: main/libmpcodecs dec_audio.c,1.28,1.29

Richard Felker CVS rfelker at mplayerhq.hu
Tue Jan 27 07:30:18 CET 2004


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv1219/libmpcodecs

Modified Files:
	dec_audio.c 
Log Message:
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...


Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- dec_audio.c	27 Jan 2004 05:10:59 -0000	1.28
+++ dec_audio.c	27 Jan 2004 06:30:16 -0000	1.29
@@ -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);




More information about the MPlayer-cvslog mailing list