From d16d6eb53869e8380ccfbe7dbc2c09d98c40ab6c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 21 Jul 2014 17:17:03 +0200 Subject: Refactor audio player, add retry timeout Fixes #442. --- src/player.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/player.h') diff --git a/src/player.h b/src/player.h index 2c89c93..eb06d64 100644 --- a/src/player.h +++ b/src/player.h @@ -31,14 +31,17 @@ THE SOFTWARE. #include #include +#include +#include #include #include #include #include #include "settings.h" +#include "config.h" -struct audioPlayer { +typedef struct { /* protected by pauseMutex */ volatile bool doQuit; volatile bool doPause; @@ -52,9 +55,21 @@ struct audioPlayer { PLAYER_FINISHED, } mode; + /* libav */ AVFilterContext *fvolume; AVFilterGraph *fgraph; - + AVFormatContext *fctx; + AVStream *st; + AVFilterContext *fbufsink, *fabuf; + int streamIdx; + int64_t lastTimestamp; +#ifndef HAVE_AV_TIMEOUT + int64_t ping; +#endif + + ao_device *aoDev; + + /* settings */ volatile double volume; double gain; char *url; @@ -63,12 +78,12 @@ struct audioPlayer { /* measured in seconds */ volatile unsigned int songDuration; volatile unsigned int songPlayed; -}; +} player_t; enum {PLAYER_RET_OK = 0, PLAYER_RET_HARDFAIL = 1, PLAYER_RET_SOFTFAIL = 2}; void *BarPlayerThread (void *data); -void BarPlayerSetVolume (struct audioPlayer * const player); +void BarPlayerSetVolume (player_t * const player); void BarPlayerInit (); void BarPlayerDestroy (); -- cgit v1.2.3