From 741012004b996375bba172fc4beb0bff92ce15db Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Sun, 6 Nov 2005 19:12:27 +0000 Subject: [PATCH] Disabled Musepack seeking, since it's so slow that most users conclude the codec has crashed. Left in original seek code for those who're aware of the issue and want seek support. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7767 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/mpc.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c index 0cb4095d86..fb42447d86 100644 --- a/apps/codecs/mpc.c +++ b/apps/codecs/mpc.c @@ -137,15 +137,29 @@ next_track: /* This is the decoding loop. */ samplesdone = 0; do { + #if 0 + /* Complete seek handler. This will be extremely slow and unresponsive + on target, so has been disabledt. */ if (ci->seek_time) { - mpc_int64_t new_sample_offset = ci->seek_time*info.sample_freq/1000; - if (mpc_decoder_seek_sample(&decoder, new_sample_offset)) { - samplesdone = new_sample_offset; + mpc_int64_t new_offset = (ci->seek_time - 1)*info.sample_freq/1000; + if (mpc_decoder_seek_sample(&decoder, new_offset)) { + samplesdone = new_offset; ci->set_elapsed(ci->seek_time); } ci->seek_complete(); } - + #else + /* Seek to start of track handler. This is the only case that isn't slow + as hell, and needs to be supported for the back button to function as + wanted. */ + if (ci->seek_time == 1) { + if (mpc_decoder_seek_sample(&decoder, 0)) { + samplesdone = 0; + ci->set_elapsed(0); + } + ci->seek_complete(); + } + #endif if (ci->stop_codec || ci->reload_codec) break; @@ -160,7 +174,7 @@ next_track: samplesdone += status; ci->set_elapsed(samplesdone/(frequency/1000)); } - } while (status != 0) ; + } while (status != 0); if (ci->request_next_track()) goto next_track;