From c7b1e3a9ca67bc1c7d50246c34156ba3b1c04b7e Mon Sep 17 00:00:00 2001 From: jethead71 Date: Mon, 20 Dec 2010 07:58:02 +0000 Subject: [PATCH] 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 --- apps/plugins/mpegplayer/stream_mgr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c index 67ec16cbb..cee384fb7 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; -- 2.11.4.GIT