summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-01-27 06:30:16 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-01-27 06:30:16 +0000
commit672cd3861fca030b27163e6a0969c11b37de8b4e (patch)
treeeaf6208394f3d3e17c6faed218b5f2601604f62c
parenta38d15e8afb8cfbd74d35c0691d8f79c408a1967 (diff)
downloadmpv-672cd3861fca030b27163e6a0969c11b37de8b4e.tar.bz2
mpv-672cd3861fca030b27163e6a0969c11b37de8b4e.tar.xz
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... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11858 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpcodecs/dec_audio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index e83c76930d..2f31e1b023 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -438,8 +438,10 @@ int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
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);