mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 05:03:17 -05:00
[player] Don't send metadata before the input has started
Otherwise we have a race condition between the worker and the input thread. If the worker returns with metadata before the input thread has started reading, then pb_session.pts will still be zero, which means metadata->pts will be zero in finalize_cb(). That is an invalid time to give the outputs.
This commit is contained in:
parent
e2205e2399
commit
4491928466
@ -987,6 +987,9 @@ event_play_start()
|
||||
{
|
||||
DPRINTF(E_DBG, L_PLAYER, "event_play_start()\n");
|
||||
|
||||
if (!pb_session.playing_now->prev)
|
||||
outputs_metadata_send(pb_session.playing_now->item_id, true, metadata_finalize_cb);
|
||||
|
||||
session_update_play_start();
|
||||
|
||||
status_update(PLAY_PLAYING);
|
||||
@ -1899,8 +1902,6 @@ playback_start_bh(void *arg, int *retval)
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
outputs_metadata_send(pb_session.playing_now->item_id, true, metadata_finalize_cb);
|
||||
|
||||
status_update(PLAY_PLAYING);
|
||||
|
||||
*retval = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user