diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-11-29 19:48:57 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-11-29 19:48:57 +0000 |
commit | 3c63cb29e945ae8e4af1a682f35f04cae5445e19 (patch) | |
tree | 7684edbdcc7cd90471ae4567ced3f43906b15267 /apps/codecs/libmusepack | |
parent | 16d736d3c76204d60c86531f8f434b83909e0a4a (diff) | |
download | rockbox-3c63cb29e945ae8e4af1a682f35f04cae5445e19.tar.gz rockbox-3c63cb29e945ae8e4af1a682f35f04cae5445e19.zip |
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
Diffstat (limited to 'apps/codecs/libmusepack')
-rw-r--r-- | apps/codecs/libmusepack/mpc_demux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/codecs/libmusepack/mpc_demux.c b/apps/codecs/libmusepack/mpc_demux.c index 97a431e597..3f4c9d021a 100644 --- a/apps/codecs/libmusepack/mpc_demux.c +++ b/apps/codecs/libmusepack/mpc_demux.c @@ -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 |