summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-05-26 15:05:57 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-05-26 15:05:57 +0200
commitf54c15c8b1b88c9689cadf9a9bc43a5f735f4b8e (patch)
treecf961f4d39df16fb050ba22a8d975a96e4e8463b
parent81bf363ac69e0036562434ca0e7153c3e624c8c3 (diff)
downloadpianobar-f54c15c8b1b88c9689cadf9a9bc43a5f735f4b8e.tar.gz
pianobar-f54c15c8b1b88c9689cadf9a9bc43a5f735f4b8e.tar.bz2
pianobar-f54c15c8b1b88c9689cadf9a9bc43a5f735f4b8e.zip
Revert "Fix player thread teardown/signals on OS X"
This reverts commit f6dffd1822404522b8354ac453a911a0d98bfc61.
-rw-r--r--src/player.c10
-rw-r--r--src/player.h4
-rw-r--r--src/ui_act.c4
3 files changed, 2 insertions, 16 deletions
diff --git a/src/player.c b/src/player.c
index f53feaa..b743ee8 100644
--- a/src/player.c
+++ b/src/player.c
@@ -156,15 +156,9 @@ static WaitressCbReturn_t BarPlayerAACCb (void *ptr, size_t size,
for (i = 0; i < frameInfo.samples; i++) {
aacDecoded[i] = applyReplayGain (aacDecoded[i], player->scale);
}
-
- int oldstate;
- pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
/* ao_play needs bytes: 1 sample = 16 bits = 2 bytes */
ao_play (player->audioOutDevice, (char *) aacDecoded,
frameInfo.samples * 2);
- pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &oldstate);
- pthread_testcancel();
-
/* add played frame length to played time, explained below */
player->songPlayed += (unsigned long long int) frameInfo.samples *
(unsigned long long int) BAR_PLAYER_MS_TO_S_FACTOR /
@@ -391,13 +385,9 @@ static WaitressCbReturn_t BarPlayerMp3Cb (void *ptr, size_t size,
* be visible to user (ugly, but mp3 decoding != aac decoding) */
player->mode = PLAYER_RECV_DATA;
}
- int oldstate;
- pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
/* samples * length * channels */
ao_play (player->audioOutDevice, (char *) madDecoded,
player->mp3Synth.pcm.length * 2 * 2);
- pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &oldstate);
- pthread_testcancel();
/* avoid division by 0 */
if (player->mode == PLAYER_RECV_DATA) {
diff --git a/src/player.h b/src/player.h
index 1e04f9f..2261d44 100644
--- a/src/player.h
+++ b/src/player.h
@@ -47,8 +47,8 @@ THE SOFTWARE.
#define BAR_PLAYER_MS_TO_S_FACTOR 1000
#define BAR_PLAYER_BUFSIZE (WAITRESS_BUFFER_SIZE*2)
-#define BAR_PLAYER_SIGSTOP SIGUSR1
-#define BAR_PLAYER_SIGCONT SIGUSR2
+#define BAR_PLAYER_SIGSTOP SIGRTMIN
+#define BAR_PLAYER_SIGCONT SIGRTMIN+1
struct audioPlayer {
unsigned char channels;
diff --git a/src/ui_act.c b/src/ui_act.c
index a4fc1f7..2cc3197 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -54,10 +54,6 @@ 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);
}
}