1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

avoid reading more than maxlen bytes.

Has the sideeffect that the amount read will be close to maxlen instead
of minlen as before.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16308 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-08-25 19:46:20 +00:00
parent 5d4798359e
commit 341e1c97e9

View File

@ -98,8 +98,8 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...)
static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
{
int len=sh_audio->channels*sh_audio->samplesize-1;
len=(minlen+len)&(~len); // sample align
unsigned len = sh_audio->channels*sh_audio->samplesize;
len = maxlen - maxlen % len; // sample align
len=demux_read_data(sh_audio->ds,buf,len);
return len;
}