summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-01-19 15:31:52 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-01-19 15:31:52 +0100
commit1c1a9cd97db7f7073144543947436e193fc98562 (patch)
tree8d306d784b1427c3762be07c2ee2d5edb1918ea9
parent33eebc7479149fb1a31a8d458649aeddd77bc44b (diff)
downloadpianobar-1c1a9cd97db7f7073144543947436e193fc98562.tar.gz
pianobar-1c1a9cd97db7f7073144543947436e193fc98562.tar.bz2
pianobar-1c1a9cd97db7f7073144543947436e193fc98562.zip
player: Avoid deadlock
When the play thread receives an error (ret < 0), it waits for aoplayCond. But if the buffer is full (decode thread waiting for aoplayCond), the player deadlocks. See #672.
-rw-r--r--src/player.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c
index 952ff18..e415023 100644
--- a/src/player.c
+++ b/src/player.c
@@ -528,6 +528,7 @@ void *BarAoPlayThread (void *data) {
break;
} else if (ret < 0) {
/* wait for more frames */
+ pthread_cond_broadcast (&player->aoplayCond);
pthread_cond_wait (&player->aoplayCond, &player->aoplayLock);
pthread_mutex_unlock (&player->aoplayLock);
continue;