diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-04-20 11:49:02 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-05-14 12:07:52 +0200 |
commit | 7df9371491e96a99c1e463f7787aede352ac5a37 (patch) | |
tree | 543ac60162bae17c03a3adb21c0db3d8ac5317b8 /src/player.h | |
parent | c4330c3f65b2eacd3433ba19b1483f6704303205 (diff) | |
download | pianobar-7df9371491e96a99c1e463f7787aede352ac5a37.tar.gz pianobar-7df9371491e96a99c1e463f7787aede352ac5a37.tar.bz2 pianobar-7df9371491e96a99c1e463f7787aede352ac5a37.zip |
Remove pause mutex/add pthread cleanup function
No more mutex locking/checking for quit condition. Should (slightly)
increase responsiveness of the player thread. Closes #250.
Diffstat (limited to 'src/player.h')
-rw-r--r-- | src/player.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/player.h b/src/player.h index ac6853c..2261d44 100644 --- a/src/player.h +++ b/src/player.h @@ -47,11 +47,11 @@ THE SOFTWARE. #define BAR_PLAYER_MS_TO_S_FACTOR 1000 #define BAR_PLAYER_BUFSIZE (WAITRESS_BUFFER_SIZE*2) +#define BAR_PLAYER_SIGSTOP SIGRTMIN +#define BAR_PLAYER_SIGCONT SIGRTMIN+1 struct audioPlayer { - char doQuit; unsigned char channels; - unsigned char aoError; enum { PLAYER_FREED = 0, /* thread is not running */ @@ -64,6 +64,10 @@ struct audioPlayer { PLAYER_RECV_DATA, /* playing track */ PLAYER_FINISHED_PLAYBACK } mode; + enum { + PLAYER_RET_OK = 0, + PLAYER_RET_ERR = 1, + } ret; PianoAudioFormat_t audioFormat; unsigned int scale; @@ -101,12 +105,11 @@ struct audioPlayer { unsigned char *buffer; - pthread_mutex_t pauseMutex; + bool paused; + pthread_t thread; WaitressHandle_t waith; }; -enum {PLAYER_RET_OK = 0, PLAYER_RET_ERR = 1}; - void *BarPlayerThread (void *data); unsigned int BarPlayerCalcScale (float); |