diff options
-rw-r--r-- | apps/playlist.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 9aae05f512..d71257a515 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -576,20 +576,24 @@ static int add_indices_to_playlist(struct playlist_info* playlist, | |||
576 | mutex_lock(playlist->control_mutex); /* read can yield! */ | 576 | mutex_lock(playlist->control_mutex); /* read can yield! */ |
577 | 577 | ||
578 | if(-1 == playlist->fd) | 578 | if(-1 == playlist->fd) |
579 | { | ||
579 | playlist->fd = open_utf8(playlist->filename, O_RDONLY); | 580 | playlist->fd = open_utf8(playlist->filename, O_RDONLY); |
581 | if(playlist->fd >= 0 && lseek(playlist->fd, 0, SEEK_CUR) > 0) | ||
582 | playlist->utf8 = true; /* Override any earlier indication. */ | ||
583 | } | ||
584 | |||
580 | if(playlist->fd < 0) | 585 | if(playlist->fd < 0) |
581 | return -1; /* failure */ | 586 | return -1; /* failure */ |
582 | playlist_fd = playlist->fd; | ||
583 | 587 | ||
584 | if((i = lseek(playlist->fd, 0, SEEK_CUR)) > 0) | 588 | i = lseek(playlist->fd, playlist->utf8 ? BOM_UTF_8_SIZE : 0, SEEK_SET); |
585 | playlist->utf8 = true; /* Override any earlier indication. */ | 589 | |
590 | playlist_fd = playlist->fd; | ||
591 | playlist->fd = -2; /* DEBUGGING Remove me! */ | ||
586 | 592 | ||
587 | splash(0, ID2P(LANG_WAIT)); | 593 | splash(0, ID2P(LANG_WAIT)); |
588 | 594 | ||
589 | store_index = true; | 595 | store_index = true; |
590 | 596 | ||
591 | playlist->fd = -2; /* DEBUGGING Remove me! */ | ||
592 | |||
593 | /* invalidate playlist in case we yield */ | 597 | /* invalidate playlist in case we yield */ |
594 | int amount = playlist->amount; | 598 | int amount = playlist->amount; |
595 | playlist->amount = -1; | 599 | playlist->amount = -1; |