summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 23dfa40c9f..7652e2924d 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -457,6 +457,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
457 unsigned int count = 0; 457 unsigned int count = 0;
458 bool store_index; 458 bool store_index;
459 unsigned char *p; 459 unsigned char *p;
460 int result = 0;
460 461
461 if(-1 == playlist->fd) 462 if(-1 == playlist->fd)
462 playlist->fd = open(playlist->filename, O_RDONLY); 463 playlist->fd = open(playlist->filename, O_RDONLY);
@@ -506,16 +507,18 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
506 507
507 if(*p != '#') 508 if(*p != '#')
508 { 509 {
510 if ( playlist->amount >= playlist->max_playlist_size ) {
511 display_buffer_full();
512 result = -1;
513 goto exit;
514 }
515
509 /* Store a new entry */ 516 /* Store a new entry */
510 playlist->indices[ playlist->amount ] = i+count; 517 playlist->indices[ playlist->amount ] = i+count;
511#ifdef HAVE_DIRCACHE 518#ifdef HAVE_DIRCACHE
512 if (playlist->filenames) 519 if (playlist->filenames)
513 playlist->filenames[ playlist->amount ] = NULL; 520 playlist->filenames[ playlist->amount ] = NULL;
514#endif 521#endif
515 if ( playlist->amount >= playlist->max_playlist_size ) {
516 display_buffer_full();
517 return -1;
518 }
519 playlist->amount++; 522 playlist->amount++;
520 } 523 }
521 } 524 }
@@ -524,11 +527,12 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
524 i+= count; 527 i+= count;
525 } 528 }
526 529
530exit:
527#ifdef HAVE_DIRCACHE 531#ifdef HAVE_DIRCACHE
528 queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0); 532 queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0);
529#endif 533#endif
530 534
531 return 0; 535 return result;
532} 536}
533 537
534/* 538/*