From c674415a162dbe8776197f82850a35339b61d632 Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Sun, 25 Aug 2002 05:11:25 +0000 Subject: 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 --- firmware/mpeg.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'firmware/mpeg.c') 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 { -- cgit v1.2.3