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 | |
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
-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) | |||
625 | } | 625 | } |
626 | 626 | ||
627 | mpc_status mpc_demux_decode(mpc_demux * d, mpc_frame_info * i) { | 627 | mpc_status mpc_demux_decode(mpc_demux * d, mpc_frame_info * i) { |
628 | mpc_status s = mpc_demux_decode_inner(d, i); | 628 | for(;;) { |
629 | if (MPC_IS_FAILURE(s)) | 629 | // mpc_demux_decode_inner may return 0 samples and require repeated calls after a seek. Loop over until we have data to return. |
630 | i->bits = -1; // we pretend it's end of file | 630 | mpc_status s = mpc_demux_decode_inner(d, i); |
631 | return s; | 631 | if (MPC_IS_FAILURE(s)) |
632 | i->bits = -1; // we pretend it's end of file | ||
633 | |||
634 | if (MPC_IS_FAILURE(s) || i->samples > 0) | ||
635 | return s; | ||
636 | } | ||
632 | } | 637 | } |
633 | 638 | ||
634 | /* rockbox: not used | 639 | /* rockbox: not used |