From be10817e1c09d5a41710435cf6d58deb6dde9301 Mon Sep 17 00:00:00 2001 From: Nick Peskett Date: Mon, 19 Mar 2012 09:56:38 +0000 Subject: Option to constrain get_next_dir() to directories below global_settings.start_directory. When enabled, if the user has set "Start File Browser Here" (config.cfg: start directory) to anything other than root and "Auto-Change Directory" is set to "Yes" or "Random", the directory returned when an auto change is required will be constrained to the value of "start directory" or below. Change-Id: Iaab773868c4cab5a54f6ae67bdb22e84642a9e4b Reviewed-on: http://gerrit.rockbox.org/182 Reviewed-by: Nick Peskett Tested-by: Nick Peskett --- apps/playback.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index 8fe43eb884..28f664357c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2644,8 +2644,17 @@ static void audio_on_skip(void) skip_pending = TRACK_SKIP_NONE; /* Update the playlist current track now */ - while (playlist_next(playlist_delta) < 0) + int pl_retval; + while ((pl_retval = playlist_next(playlist_delta)) < 0) { + if (pl_retval < -1) + { + /* Some variety of fatal error while updating playlist */ + filling = STATE_ENDED; + audio_stop_playback(); + return; + } + /* Manual skip out of range (because the playlist wasn't updated yet by us and so the check in audio_skip returned 'ok') - bring back into range */ -- cgit v1.2.3