diff options
author | edward-p <micro.fedora@gmail.com> | 2018-09-15 13:57:39 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-09-15 14:01:05 +0200 |
commit | bbbdd99fdaacfe0a3c9a1237fa0d086907c1286f (patch) | |
tree | 0445df2e4d243e0f4f51a9a6e3658bf0335040df /src/player.h | |
parent | cf82c5eba208ddc327f7620d1961c9c719c4e13c (diff) | |
download | pianobar-bbbdd99fdaacfe0a3c9a1237fa0d086907c1286f.tar.gz pianobar-bbbdd99fdaacfe0a3c9a1237fa0d086907c1286f.tar.bz2 pianobar-bbbdd99fdaacfe0a3c9a1237fa0d086907c1286f.zip |
Implement audio buffering
Prevent stuttering on low-power devices like Android phones by moving
playback to its own thread and decoupling it from decoding through a
reasonably sized buffer.
Fixes #665.
Diffstat (limited to 'src/player.h')
-rw-r--r-- | src/player.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/player.h b/src/player.h index e9482c4..3179785 100644 --- a/src/player.h +++ b/src/player.h @@ -51,9 +51,8 @@ typedef enum { typedef struct { /* public attributes protected by mutex */ - pthread_mutex_t lock; - pthread_cond_t cond; /* broadcast changes to doPause */ - + pthread_mutex_t lock, aoplayLock; + pthread_cond_t cond, aoplayCond; /* broadcast changes to doPause */ bool doQuit, doPause; /* measured in seconds */ @@ -86,6 +85,7 @@ typedef struct { enum {PLAYER_RET_OK = 0, PLAYER_RET_HARDFAIL = 1, PLAYER_RET_SOFTFAIL = 2}; void *BarPlayerThread (void *data); +void *BarAoPlayThread (void *data); void BarPlayerSetVolume (player_t * const player); void BarPlayerInit (player_t * const p, const BarSettings_t * const settings); void BarPlayerReset (player_t * const p); |