In playlist mode, the old code skipped the first entry of the list,
i.e para_server began streaming using the second playlist entry.
The fix is to set current_playlist_entry to the last entry of the list
whenever a new playlist is loaded.
Thanks to Gerrit Renker for reporting this bug.
unsigned i;
PARA_DEBUG_LOG("sending playlist to client (%d entries)\n", playlist_len);
- for (i = 0; i < playlist_len; i++) {
+ for (i = 1; i <= playlist_len; i++) {
int ret = send_va_buffer(fd, "%s\n", playlist[
(i + current_playlist_entry) % playlist_len]);
if (ret < 0)
PARA_NOTICE_LOG("new playlist (%d entries)\n", playlist_len);
sprintf(mmd->selector_info, "dbinfo1:new playlist: %d files\n"
"dbinfo2:\ndbinfo3:\n", playlist_len);
+ current_playlist_entry = playlist_len - 1;
pcd->retval = 1;
pcd->size = 0;
mutex_unlock(pcd->mutex);