diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-05-16 14:18:27 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-05-17 21:55:57 +0200 |
commit | f6dffd1822404522b8354ac453a911a0d98bfc61 (patch) | |
tree | 46fec199f0e4e5f59588f75c5ed1446a06e13367 /src/ui_act.c | |
parent | c922257347ee0cf5ea6cdd65786da2774c79c132 (diff) | |
download | pianobar-f6dffd1822404522b8354ac453a911a0d98bfc61.tar.gz pianobar-f6dffd1822404522b8354ac453a911a0d98bfc61.tar.bz2 pianobar-f6dffd1822404522b8354ac453a911a0d98bfc61.zip |
Fix player thread teardown/signals on OS X
1) Realtime signals don’t exist in OS X
2) libao apparently locks a mutex in ao_play, which is locked again in
ao_close and causes a deadlock
Closes #256, although I’m considering the option of partially reverting
7df9371491e96a99c1e463f7787aede352ac5a37, as this introduces more nasty
behavior than it solves.
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui_act.c b/src/ui_act.c index 2cc3197..a4fc1f7 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -54,6 +54,10 @@ static inline void BarUiDoSkipSong (struct audioPlayer *player) { assert (player != NULL); if (player->mode != PLAYER_FINISHED_PLAYBACK && player->mode != PLAYER_FREED) { + /* unpause to make sure thread is able to reach cancellation point */ + if (player->paused) { + pthread_kill (player->thread, BAR_PLAYER_SIGCONT); + } pthread_cancel (player->thread); } } |