mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[player] Fix problem where player_playback_cb triggers after playback stop
This commit is contained in:
parent
3e24f857fa
commit
c92ebf9dfb
@ -236,6 +236,12 @@ input_read(struct evbuffer *evbuf, size_t want, short *flags)
|
||||
|
||||
*flags = 0;
|
||||
|
||||
if (!tid_input)
|
||||
{
|
||||
DPRINTF(E_LOG, L_PLAYER, "Bug! Read called, but playback not running\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&input_buffer.mutex);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
13
src/player.c
13
src/player.c
@ -355,6 +355,15 @@ pb_timer_start(void)
|
||||
struct itimerspec tick;
|
||||
int ret;
|
||||
|
||||
ret = event_add(pb_timer_ev, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_PLAYER, "Could not add playback timer\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
tick.it_interval = tick_interval;
|
||||
tick.it_value = tick_interval;
|
||||
|
||||
@ -379,6 +388,8 @@ pb_timer_stop(void)
|
||||
struct itimerspec tick;
|
||||
int ret;
|
||||
|
||||
event_del(pb_timer_ev);
|
||||
|
||||
memset(&tick, 0, sizeof(struct itimerspec));
|
||||
|
||||
#ifdef HAVE_TIMERFD
|
||||
@ -3245,8 +3256,6 @@ player_init(void)
|
||||
goto evnew_fail;
|
||||
}
|
||||
|
||||
event_add(pb_timer_ev, NULL);
|
||||
|
||||
cmdbase = commands_base_new(evbase_player, NULL);
|
||||
|
||||
ret = outputs_init();
|
||||
|
Loading…
Reference in New Issue
Block a user