mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
[player] Fix proceed to next if track cannot be opened
This commit is contained in:
parent
9773d9b840
commit
d10e8ab1a2
18
src/player.c
18
src/player.c
@ -730,11 +730,11 @@ session_update_play_start(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
session_update_read_next(void)
|
session_update_read_next(struct player_source *current)
|
||||||
{
|
{
|
||||||
struct player_source *ps;
|
struct player_source *ps;
|
||||||
|
|
||||||
ps = source_next_create(pb_session.reading_now);
|
ps = source_next_create(current);
|
||||||
source_free(&pb_session.reading_next);
|
source_free(&pb_session.reading_next);
|
||||||
pb_session.reading_next = ps;
|
pb_session.reading_next = ps;
|
||||||
}
|
}
|
||||||
@ -893,7 +893,7 @@ event_read_start_next()
|
|||||||
DPRINTF(E_DBG, L_PLAYER, "event_read_start_next()\n");
|
DPRINTF(E_DBG, L_PLAYER, "event_read_start_next()\n");
|
||||||
|
|
||||||
// Attaches next item to session as reading_next
|
// Attaches next item to session as reading_next
|
||||||
session_update_read_next();
|
session_update_read_next(pb_session.reading_now);
|
||||||
|
|
||||||
source_next();
|
source_next();
|
||||||
}
|
}
|
||||||
@ -1585,6 +1585,7 @@ static int
|
|||||||
pb_session_start(struct db_queue_item *queue_item, uint32_t seek_ms)
|
pb_session_start(struct db_queue_item *queue_item, uint32_t seek_ms)
|
||||||
{
|
{
|
||||||
struct player_source *ps;
|
struct player_source *ps;
|
||||||
|
uint32_t item_id;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ps = source_new(queue_item);
|
ps = source_new(queue_item);
|
||||||
@ -1595,9 +1596,10 @@ pb_session_start(struct db_queue_item *queue_item, uint32_t seek_ms)
|
|||||||
// Sets of opening of the new source
|
// Sets of opening of the new source
|
||||||
while ( (ret = source_start()) < 0)
|
while ( (ret = source_start()) < 0)
|
||||||
{
|
{
|
||||||
// Couldn't start requested item, remove it from queue and try next in line
|
// Couldn't start requested item, skip to next and remove failed item from queue
|
||||||
db_queue_delete_byitemid(pb_session.reading_next->item_id);
|
item_id = pb_session.reading_next->item_id;
|
||||||
session_update_read_next();
|
session_update_read_next(pb_session.reading_next);
|
||||||
|
db_queue_delete_byitemid(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
session_update_read_start((uint32_t)ret);
|
session_update_read_start((uint32_t)ret);
|
||||||
@ -1605,10 +1607,6 @@ pb_session_start(struct db_queue_item *queue_item, uint32_t seek_ms)
|
|||||||
if (!pb_session.playing_now)
|
if (!pb_session.playing_now)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// The input source is now open and ready, but we might actually be paused. So
|
|
||||||
// we activate the below event in case the user never starts us again
|
|
||||||
// event_add(player_pause_timeout_ev, &player_pause_timeout);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user