mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 06:42:03 +00: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:
parent
5d4798359e
commit
341e1c97e9
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user