summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-12-24 17:27:39 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-12-24 17:27:39 +0100
commita33f98d90779740c49987bd825ceb560c0ffb1f5 (patch)
tree16fdeee33c82ba1d82446953b77bb14d803a1e93 /src/player.h
parent357153c25547d0e797bbb3d1390a947c4268273e (diff)
downloadpianobar-a33f98d90779740c49987bd825ceb560c0ffb1f5.tar.gz
pianobar-a33f98d90779740c49987bd825ceb560c0ffb1f5.tar.bz2
pianobar-a33f98d90779740c49987bd825ceb560c0ffb1f5.zip
Avoid struct padding where possible
Pointed out by -Wpadding. Does not decrease memory usage/binary size though.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/player.h b/src/player.h
index 248519f..070ac0f 100644
--- a/src/player.h
+++ b/src/player.h
@@ -47,11 +47,9 @@ THE SOFTWARE.
#define BAR_PLAYER_MS_TO_S_FACTOR 1000
struct audioPlayer {
- /* buffer; should be large enough */
- unsigned char buffer[WAITRESS_BUFFER_SIZE*2];
- size_t bufferFilled;
- size_t bufferRead;
- size_t bytesReceived;
+ char doQuit;
+ unsigned char channels;
+ unsigned char aoError;
enum {
PLAYER_FREED = 0, /* thread is not running */
@@ -64,20 +62,28 @@ struct audioPlayer {
PLAYER_RECV_DATA, /* playing track */
PLAYER_FINISHED_PLAYBACK
} mode;
-
PianoAudioFormat_t audioFormat;
+ unsigned int scale;
+ float gain;
+
/* duration and already played time; measured in milliseconds */
unsigned long int songDuration;
unsigned long int songPlayed;
+ unsigned long samplerate;
+
+ size_t bufferFilled;
+ size_t bufferRead;
+ size_t bytesReceived;
+
/* aac */
#ifdef ENABLE_FAAD
- NeAACDecHandle aacHandle;
/* stsz atom: sample sizes */
- unsigned int *sampleSize;
size_t sampleSizeN;
size_t sampleSizeCurr;
+ unsigned int *sampleSize;
+ NeAACDecHandle aacHandle;
#endif
/* mp3 */
@@ -87,22 +93,14 @@ struct audioPlayer {
struct mad_synth mp3Synth;
#endif
- unsigned long samplerate;
- unsigned char channels;
-
- float gain;
- unsigned int scale;
-
/* audio out */
ao_device *audioOutDevice;
- unsigned char aoError;
-
- WaitressHandle_t waith;
+ const BarSettings_t *settings;
- char doQuit;
pthread_mutex_t pauseMutex;
-
- const BarSettings_t *settings;
+ WaitressHandle_t waith;
+ /* buffer; should be large enough */
+ unsigned char buffer[WAITRESS_BUFFER_SIZE*2];
};
enum {PLAYER_RET_OK = 0, PLAYER_RET_ERR = 1};