mirror of
https://github.com/mpv-player/mpv
synced 2025-03-07 14:47:53 +00:00
Fixing the fix buffer overrun should work now
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7591 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7ca1ef4974
commit
94f26b18df
@ -370,7 +370,7 @@ af_data_t* af_play(af_stream_t* s, af_data_t* data)
|
||||
needed */
|
||||
inline int af_lencalc(frac_t mul, af_data_t* d){
|
||||
register int t = d->bps*d->nch;
|
||||
return t*(((d->len/t)*mul.n + 1)/mul.d);
|
||||
return t*(((d->len/t)*mul.n)/mul.d + 1);
|
||||
}
|
||||
|
||||
/* Calculate how long the output from the filters will be given the
|
||||
|
@ -122,7 +122,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||
|
||||
// Reset unused channels if nch in < nch out
|
||||
if(af->mul.n > af->mul.d)
|
||||
memset(l->audio,0,af_lencalc(af->mul, c));
|
||||
memset(l->audio,0,(c->len*af->mul.n)/af->mul.d);
|
||||
|
||||
// Special case always output L & R
|
||||
if(c->nch == 1){
|
||||
@ -143,7 +143,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||
|
||||
// Set output data
|
||||
c->audio = l->audio;
|
||||
c->len = af_lencalc(af->mul, c);
|
||||
c->len = (c->len*af->mul.n)/af->mul.d;
|
||||
c->nch = l->nch;
|
||||
|
||||
return c;
|
||||
|
Loading…
Reference in New Issue
Block a user