summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-06-20 19:33:03 +0000
committerThomas Martitz <kugel@rockbox.org>2011-06-20 19:33:03 +0000
commit1a86aab1a26b6efddd843cad8a68cb49c30e36ec (patch)
tree33c45e94f9cb3e920cab29eb27334e9593ec90d3 /apps/playlist.c
parent316f9a0238794d5219db5b60bf28f79aa77c8966 (diff)
downloadrockbox-1a86aab1a26b6efddd843cad8a68cb49c30e36ec.tar.gz
rockbox-1a86aab1a26b6efddd843cad8a68cb49c30e36ec.tar.bz2
rockbox-1a86aab1a26b6efddd843cad8a68cb49c30e36ec.zip
Remove unused code path from playlist_create_ex().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30030 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index d17bf230a5..62f85eab40 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -2676,8 +2676,10 @@ void playlist_set_last_shuffled_start(void)
/*
* Create a new playlist If playlist is not NULL then we're loading a
* playlist off disk for viewing/editing. The index_buffer is used to store
- * playlist indices (required for and only used if !current playlist). The
- * temp_buffer (if not NULL) is used as a scratchpad when loading indices.
+ * playlist indices (required for and only used if playlist != NULL). The
+ * temp_buffer is used as a scratchpad when loading indices.
+ *
+ * returns <0 on failure
*/
int playlist_create_ex(struct playlist_info* playlist,
const char* dir, const char* file,
@@ -2688,6 +2690,8 @@ int playlist_create_ex(struct playlist_info* playlist,
playlist = &current_playlist;
else
{
+ if (!index_buffer)
+ return -1;
/* Initialize playlist structure */
int r = rand() % 10;
playlist->current = false;
@@ -2698,31 +2702,20 @@ int playlist_create_ex(struct playlist_info* playlist,
playlist->fd = -1;
playlist->control_fd = -1;
- if (index_buffer)
- {
- int num_indices = index_buffer_size / sizeof(int);
+ int num_indices = index_buffer_size / sizeof(int);
#ifdef HAVE_DIRCACHE
- num_indices /= 2;
+ num_indices /= 2;
#endif
- if (num_indices > global_settings.max_files_in_playlist)
- num_indices = global_settings.max_files_in_playlist;
+ if (num_indices > global_settings.max_files_in_playlist)
+ num_indices = global_settings.max_files_in_playlist;
- playlist->max_playlist_size = num_indices;
- playlist->indices = index_buffer;
+ playlist->max_playlist_size = num_indices;
+ playlist->indices = index_buffer;
#ifdef HAVE_DIRCACHE
- playlist->filenames = (const struct dircache_entry **)
- &playlist->indices[num_indices];
+ playlist->filenames = (const struct dircache_entry **)
+ &playlist->indices[num_indices];
#endif
- }
- else
- {
- playlist->max_playlist_size = current_playlist.max_playlist_size;
- playlist->indices = current_playlist.indices;
-#ifdef HAVE_DIRCACHE
- playlist->filenames = current_playlist.filenames;
-#endif
- }
playlist->buffer_size = 0;
playlist->buffer = NULL;