summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2002-08-25 05:11:25 +0000
committerHardeep Sidhu <dyp@pobox.com>2002-08-25 05:11:25 +0000
commitc674415a162dbe8776197f82850a35339b61d632 (patch)
tree2ffb5ba8a58910bd36232bcfe7203c5c66d53c9b /firmware/mpeg.c
parente60a999ca08545b8e699b6b8439387b66d390e38 (diff)
Make sure there is sufficient data in buffer before resuming after ffw.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1970 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r--firmware/mpeg.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 6f2b3dfafe..d19cdf65e4 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -953,11 +953,18 @@ static void mpeg_thread(void)
mp3buf_read += mp3buflen;
}
- playing = true;
- last_dma_tick = current_tick;
- init_dma();
- if (!paused)
- start_dma();
+ if (get_unplayed_space() < MPEG_LOW_WATER)
+ {
+ /* We need to load more data before starting */
+ filling = true;
+ queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
+ play_pending = true;
+ }
+ else
+ {
+ /* resume will start at new position */
+ init_dma();
+ }
}
else
{