From cab3a164178ff1720b24f111173bab19cab5c45d Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Thu, 11 May 2006 19:14:18 +0000 Subject: Return immediately if we have no control commands to flush. Fixes erroneous playlist control update error when inserting tracks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9912 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index a63d974a7f..9adc2c088c 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1652,6 +1652,9 @@ static int flush_cached_control(struct playlist_info* playlist) int result = 0; int i; + if (!playlist->num_cached) + return 0; + lseek(playlist->control_fd, 0, SEEK_END); for (i=0; inum_cached; i++) @@ -1714,12 +1717,9 @@ static int flush_cached_control(struct playlist_info* playlist) result = 0; } else - result = -1; - - if (result < 0) { + result = -1; gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); - return result; } return result; -- cgit v1.2.3