diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-05-11 19:14:18 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-05-11 19:14:18 +0000 |
commit | cab3a164178ff1720b24f111173bab19cab5c45d (patch) | |
tree | d1b5d7df63b3afb7a6c6a79a3349fa5644f7f9fd | |
parent | a65ec014058aacfa7937674c4b29344fa88a91b7 (diff) | |
download | rockbox-cab3a164178ff1720b24f111173bab19cab5c45d.tar.gz rockbox-cab3a164178ff1720b24f111173bab19cab5c45d.zip |
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
-rw-r--r-- | apps/playlist.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) | |||
1652 | int result = 0; | 1652 | int result = 0; |
1653 | int i; | 1653 | int i; |
1654 | 1654 | ||
1655 | if (!playlist->num_cached) | ||
1656 | return 0; | ||
1657 | |||
1655 | lseek(playlist->control_fd, 0, SEEK_END); | 1658 | lseek(playlist->control_fd, 0, SEEK_END); |
1656 | 1659 | ||
1657 | for (i=0; i<playlist->num_cached; i++) | 1660 | for (i=0; i<playlist->num_cached; i++) |
@@ -1714,12 +1717,9 @@ static int flush_cached_control(struct playlist_info* playlist) | |||
1714 | result = 0; | 1717 | result = 0; |
1715 | } | 1718 | } |
1716 | else | 1719 | else |
1717 | result = -1; | ||
1718 | |||
1719 | if (result < 0) | ||
1720 | { | 1720 | { |
1721 | result = -1; | ||
1721 | gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); | 1722 | gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); |
1722 | return result; | ||
1723 | } | 1723 | } |
1724 | 1724 | ||
1725 | return result; | 1725 | return result; |