From bf0ac613ea520df905d19d41f866f1649b18c227 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 13 Feb 2003 16:25:36 +0000 Subject: Killed a nasty bug that could leave the recorded file open. This will cause the file to be 0 bytes long. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3247 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'firmware') diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 2d14d88abf..5335c3d422 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -489,11 +489,12 @@ static bool saving; /* We are saving the buffer to disk */ static int mpeg_file; -#ifdef HAVE_MAS3587F /* Synchronization variables */ +#ifdef HAVE_MAS3587F static bool init_recording_done; static bool init_playback_done; #endif +static bool mpeg_stop_done; static void recalculate_watermark(int bitrate) { @@ -1335,6 +1336,7 @@ static void mpeg_thread(void) is_playing = false; paused = false; stop_playing(); + mpeg_stop_done = true; break; case MPEG_PAUSE: @@ -1836,6 +1838,7 @@ static void mpeg_thread(void) } } #endif + mpeg_stop_done = true; break; case MPEG_SAVE_DATA: @@ -2240,8 +2243,10 @@ void mpeg_play(int offset) void mpeg_stop(void) { #ifndef SIMULATOR + mpeg_stop_done = false; queue_post(&mpeg_queue, MPEG_STOP, NULL); - yield(); + while(!mpeg_stop_done) + yield(); #else is_playing = false; playing = false; -- cgit v1.2.3