diff options
-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 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 */ | |||
489 | 489 | ||
490 | static int mpeg_file; | 490 | static int mpeg_file; |
491 | 491 | ||
492 | #ifdef HAVE_MAS3587F | ||
493 | /* Synchronization variables */ | 492 | /* Synchronization variables */ |
493 | #ifdef HAVE_MAS3587F | ||
494 | static bool init_recording_done; | 494 | static bool init_recording_done; |
495 | static bool init_playback_done; | 495 | static bool init_playback_done; |
496 | #endif | 496 | #endif |
497 | static bool mpeg_stop_done; | ||
497 | 498 | ||
498 | static void recalculate_watermark(int bitrate) | 499 | static void recalculate_watermark(int bitrate) |
499 | { | 500 | { |
@@ -1335,6 +1336,7 @@ static void mpeg_thread(void) | |||
1335 | is_playing = false; | 1336 | is_playing = false; |
1336 | paused = false; | 1337 | paused = false; |
1337 | stop_playing(); | 1338 | stop_playing(); |
1339 | mpeg_stop_done = true; | ||
1338 | break; | 1340 | break; |
1339 | 1341 | ||
1340 | case MPEG_PAUSE: | 1342 | case MPEG_PAUSE: |
@@ -1836,6 +1838,7 @@ static void mpeg_thread(void) | |||
1836 | } | 1838 | } |
1837 | } | 1839 | } |
1838 | #endif | 1840 | #endif |
1841 | mpeg_stop_done = true; | ||
1839 | break; | 1842 | break; |
1840 | 1843 | ||
1841 | case MPEG_SAVE_DATA: | 1844 | case MPEG_SAVE_DATA: |
@@ -2240,8 +2243,10 @@ void mpeg_play(int offset) | |||
2240 | void mpeg_stop(void) | 2243 | void mpeg_stop(void) |
2241 | { | 2244 | { |
2242 | #ifndef SIMULATOR | 2245 | #ifndef SIMULATOR |
2246 | mpeg_stop_done = false; | ||
2243 | queue_post(&mpeg_queue, MPEG_STOP, NULL); | 2247 | queue_post(&mpeg_queue, MPEG_STOP, NULL); |
2244 | yield(); | 2248 | while(!mpeg_stop_done) |
2249 | yield(); | ||
2245 | #else | 2250 | #else |
2246 | is_playing = false; | 2251 | is_playing = false; |
2247 | playing = false; | 2252 | playing = false; |