diff options
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index dcf2fe1118..ea183d7552 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -575,7 +575,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist, | |||
575 | playlist->indices[ playlist->amount ] = i+count; | 575 | playlist->indices[ playlist->amount ] = i+count; |
576 | #ifdef HAVE_DIRCACHE | 576 | #ifdef HAVE_DIRCACHE |
577 | if (playlist->filenames) | 577 | if (playlist->filenames) |
578 | playlist->filenames[ playlist->amount ] = NULL; | 578 | playlist->filenames[ playlist->amount ] = -1; |
579 | #endif | 579 | #endif |
580 | playlist->amount++; | 580 | playlist->amount++; |
581 | } | 581 | } |
@@ -816,7 +816,7 @@ static int add_track_to_playlist(struct playlist_info* playlist, | |||
816 | 816 | ||
817 | #ifdef HAVE_DIRCACHE | 817 | #ifdef HAVE_DIRCACHE |
818 | if (playlist->filenames) | 818 | if (playlist->filenames) |
819 | playlist->filenames[insert_position] = NULL; | 819 | playlist->filenames[insert_position] = -1; |
820 | #endif | 820 | #endif |
821 | 821 | ||
822 | playlist->amount++; | 822 | playlist->amount++; |
@@ -958,9 +958,9 @@ static int randomise_playlist(struct playlist_info* playlist, | |||
958 | #ifdef HAVE_DIRCACHE | 958 | #ifdef HAVE_DIRCACHE |
959 | if (playlist->filenames) | 959 | if (playlist->filenames) |
960 | { | 960 | { |
961 | store = (long)playlist->filenames[candidate]; | 961 | store = playlist->filenames[candidate]; |
962 | playlist->filenames[candidate] = playlist->filenames[count]; | 962 | playlist->filenames[candidate] = playlist->filenames[count]; |
963 | playlist->filenames[count] = (struct dircache_entry *)store; | 963 | playlist->filenames[count] = store; |
964 | } | 964 | } |
965 | #endif | 965 | #endif |
966 | } | 966 | } |
@@ -1298,7 +1298,7 @@ static void playlist_thread(void) | |||
1298 | && queue_empty(&playlist_queue); index++) | 1298 | && queue_empty(&playlist_queue); index++) |
1299 | { | 1299 | { |
1300 | /* Process only pointers that are not already loaded. */ | 1300 | /* Process only pointers that are not already loaded. */ |
1301 | if (playlist->filenames[index]) | 1301 | if (playlist->filenames[index] >= 0) |
1302 | continue ; | 1302 | continue ; |
1303 | 1303 | ||
1304 | control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; | 1304 | control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; |
@@ -1310,7 +1310,7 @@ static void playlist_thread(void) | |||
1310 | break ; | 1310 | break ; |
1311 | 1311 | ||
1312 | /* Set the dircache entry pointer. */ | 1312 | /* Set the dircache entry pointer. */ |
1313 | playlist->filenames[index] = dircache_get_entry_ptr(tmp); | 1313 | playlist->filenames[index] = dircache_get_entry_id(tmp); |
1314 | 1314 | ||
1315 | /* And be on background so user doesn't notice any delays. */ | 1315 | /* And be on background so user doesn't notice any delays. */ |
1316 | yield(); | 1316 | yield(); |
@@ -1351,7 +1351,7 @@ static int get_filename(struct playlist_info* playlist, int index, int seek, | |||
1351 | #ifdef HAVE_DIRCACHE | 1351 | #ifdef HAVE_DIRCACHE |
1352 | if (dircache_is_enabled() && playlist->filenames) | 1352 | if (dircache_is_enabled() && playlist->filenames) |
1353 | { | 1353 | { |
1354 | if (playlist->filenames[index] != NULL) | 1354 | if (playlist->filenames[index] >= 0) |
1355 | { | 1355 | { |
1356 | max = dircache_copy_path(playlist->filenames[index], | 1356 | max = dircache_copy_path(playlist->filenames[index], |
1357 | tmp_buf, sizeof(tmp_buf)-1); | 1357 | tmp_buf, sizeof(tmp_buf)-1); |
@@ -2389,7 +2389,7 @@ int playlist_add(const char *filename) | |||
2389 | 2389 | ||
2390 | playlist->indices[playlist->amount] = playlist->buffer_end_pos; | 2390 | playlist->indices[playlist->amount] = playlist->buffer_end_pos; |
2391 | #ifdef HAVE_DIRCACHE | 2391 | #ifdef HAVE_DIRCACHE |
2392 | playlist->filenames[playlist->amount] = NULL; | 2392 | playlist->filenames[playlist->amount] = -1; |
2393 | #endif | 2393 | #endif |
2394 | playlist->amount++; | 2394 | playlist->amount++; |
2395 | 2395 | ||
@@ -2713,8 +2713,7 @@ int playlist_create_ex(struct playlist_info* playlist, | |||
2713 | playlist->max_playlist_size = num_indices; | 2713 | playlist->max_playlist_size = num_indices; |
2714 | playlist->indices = index_buffer; | 2714 | playlist->indices = index_buffer; |
2715 | #ifdef HAVE_DIRCACHE | 2715 | #ifdef HAVE_DIRCACHE |
2716 | playlist->filenames = (const struct dircache_entry **) | 2716 | playlist->filenames = (int*)&playlist->indices[num_indices]; |
2717 | &playlist->indices[num_indices]; | ||
2718 | #endif | 2717 | #endif |
2719 | 2718 | ||
2720 | playlist->buffer_size = 0; | 2719 | playlist->buffer_size = 0; |