From e6261734a025cd9053004ded80e06d2d9401d2e3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 23 Aug 2002 08:06:39 +0000 Subject: two fixes at once: 1. If the WPS is popped up but the mpeg thread can't play any song, we must make sure to update the screen to display the "end of playlist" thing. 2. When having reached the "end of playlist" state, pressing LEFT caused a crash (due to a NULL pointer being used). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1942 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/wps.c b/apps/wps.c index 6445b6bbf7..f2e90f397f 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -589,6 +589,7 @@ int wps_show(void) int button; int ff_rewind_count = 0; bool ignore_keyup = true; + bool restore = false; old_release_mask = button_set_release(RELEASE_MASK); @@ -609,11 +610,13 @@ int wps_show(void) id3 = mpeg_current_track(); draw_screen(id3); } + else if(!id3) + { + restore = true; + } while ( 1 ) { - bool restore = false; - button = button_get_w_tmo(HZ/5); /* discard first event if it's a button release */ @@ -814,7 +817,7 @@ int wps_show(void) else #endif { - if (id3->elapsed < 3*1000) + if (!id3 || (id3->elapsed < 3*1000)) mpeg_prev(); else { mpeg_pause(); -- cgit v1.2.3