From 60ed5ee4a120a92b34bdbd8c623303d2cce5a8d4 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 19 Jun 2002 06:19:00 +0000 Subject: MPEG_PLAY now closes mpeg_file if it is open git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1068 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 394d182..754c240 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -134,7 +134,7 @@ static bool dma_on; /* The DMA is active */ static bool playing; /* We are playing an MP3 stream */ static bool filling; /* We are filling the buffer with data from disk */ -static int mpeg_file = -1; +static int mpeg_file; static void mas_poll_start(int interval_in_ms) { @@ -302,6 +302,7 @@ static void mpeg_thread(void) play_pending = false; playing = false; + mpeg_file = -1; while(1) { @@ -318,6 +319,9 @@ static void mpeg_thread(void) reset_mp3_buffer(); + if(mpeg_file >= 0) + close(mpeg_file); + mpeg_file = open((char*)ev.data, O_RDONLY); if(mpeg_file < 0) { -- cgit v1.1