summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-12-20 07:58:02 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-12-20 07:58:02 +0000
commitea568794e73d652282aaa881a4200b9e849e398b (patch)
tree9358228c8c9e1cd476b8f737c60bc1279688c646
parentd215eb7c70fdfa5f24c8329b330c96a35483969e (diff)
downloadrockbox-ea568794e73d652282aaa881a4200b9e849e398b.tar.gz
rockbox-ea568794e73d652282aaa881a4200b9e849e398b.zip
MPEGPlayer: Fix a bug where seeking a stream into the same frame more than once in a row causes it to report itself at the end in error; to fix it, pause streams rather than stopping them if the playback isn't stopped. Also, add one check so the engine can at rewind unseekable files to time 0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28862 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c
index 67ec16cbb6..cee384fb75 100644
--- a/apps/plugins/mpegplayer/stream_mgr.c
+++ b/apps/plugins/mpegplayer/stream_mgr.c
@@ -330,8 +330,9 @@ static uint32_t stream_seek_intl(uint32_t time, int whence,
{
bool wb;
- /* Place streams in a non-running state - keep them on actl */
- actl_stream_broadcast(STREAM_STOP, 0);
+ /* Place streams in a non-running state - keep them on actl if
+ * still there */
+ actl_stream_broadcast(STREAM_PAUSE, 0);
/* Stop all buffering or else risk clobbering random-access data */
wb = disk_buf_send_msg(STREAM_STOP, 0);
@@ -557,7 +558,8 @@ static void stream_on_seek(struct stream_seek_data *skd)
stream_mgr_lock();
- if (stream_can_seek())
+ /* Either seeking must be possible or a full rewind must be done */
+ if (stream_can_seek() || time_from_whence(time, whence) == 0)
{
bool buffer;