Resync mpc to r476 of svn.musepack.org. Improves error handling after seek.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31093 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
16d736d3c7
commit
3c63cb29e9
1 changed files with 9 additions and 4 deletions
|
@ -625,10 +625,15 @@ static mpc_status mpc_demux_decode_inner(mpc_demux * d, mpc_frame_info * i)
|
|||
}
|
||||
|
||||
mpc_status mpc_demux_decode(mpc_demux * d, mpc_frame_info * i) {
|
||||
mpc_status s = mpc_demux_decode_inner(d, i);
|
||||
if (MPC_IS_FAILURE(s))
|
||||
i->bits = -1; // we pretend it's end of file
|
||||
return s;
|
||||
for(;;) {
|
||||
// mpc_demux_decode_inner may return 0 samples and require repeated calls after a seek. Loop over until we have data to return.
|
||||
mpc_status s = mpc_demux_decode_inner(d, i);
|
||||
if (MPC_IS_FAILURE(s))
|
||||
i->bits = -1; // we pretend it's end of file
|
||||
|
||||
if (MPC_IS_FAILURE(s) || i->samples > 0)
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
/* rockbox: not used
|
||||
|
|
Loading…
Reference in a new issue