mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
[player] Remove dead code and rework check if fetching queue item failed
This commit is contained in:
parent
69d3c97b7e
commit
4c835f4435
19
src/player.c
19
src/player.c
@ -2244,20 +2244,17 @@ seek_calc_position_ms(struct db_queue_item **queue_item, int *position_ms, struc
|
|||||||
{
|
{
|
||||||
// Seeking in the current queue item
|
// Seeking in the current queue item
|
||||||
seek_queue_item = db_queue_fetch_byitemid(pb_session.playing_now->item_id);
|
seek_queue_item = db_queue_fetch_byitemid(pb_session.playing_now->item_id);
|
||||||
|
|
||||||
|
if (!seek_queue_item)
|
||||||
|
{
|
||||||
|
DPRINTF(E_LOG, L_PLAYER, "Error fetching queue item for seek command (seek_ms=%d, seek_mode=%d)\n", seek_param->ms, seek_param->mode);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!seek_queue_item)
|
|
||||||
{
|
|
||||||
DPRINTF(E_LOG, L_PLAYER, "Error fetching queue item for seek command (seek_ms=%d, seek_mode=%d)\n", seek_param->ms, seek_param->mode);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (seek_ms < 0)
|
DPRINTF(E_DBG, L_PLAYER, "Seek position for seek command (seek_ms=%d, seek_mode=%d) is: seek_ms=%d, queue item id=%d\n",
|
||||||
{
|
seek_param->ms, seek_param->mode, seek_ms, seek_queue_item->id);
|
||||||
DPRINTF(E_LOG, L_PLAYER, "Error calculating new seek position for seek command (seek_ms=%d, seek_mode=%d)\n", seek_param->ms, seek_param->mode);
|
|
||||||
free_queue_item(seek_queue_item, 0);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*queue_item = seek_queue_item;
|
*queue_item = seek_queue_item;
|
||||||
*position_ms = seek_ms;
|
*position_ms = seek_ms;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user