diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2003-02-13 16:25:36 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2003-02-13 16:25:36 +0000 |
| commit | bf0ac613ea520df905d19d41f866f1649b18c227 (patch) | |
| tree | cf8c10fb31d3cec079bb85b0f6aea6118d1e7da1 | |
| parent | 07ad7c07b02cd2b17e4618df5ccd4b2266488ae8 (diff) | |
| download | rockbox-bf0ac613ea520df905d19d41f866f1649b18c227.zip rockbox-bf0ac613ea520df905d19d41f866f1649b18c227.tar.gz rockbox-bf0ac613ea520df905d19d41f866f1649b18c227.tar.bz2 rockbox-bf0ac613ea520df905d19d41f866f1649b18c227.tar.xz | |
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
| -rw-r--r-- | firmware/mpeg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 2d14d88..5335c3d 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; |