summaryrefslogtreecommitdiff
path: root/src/combined
diff options
context:
space:
mode:
Diffstat (limited to 'src/combined')
-rw-r--r--src/combined/combined_wavpack.h9
-rw-r--r--src/combined/decoder_flac.c25
2 files changed, 11 insertions, 23 deletions
diff --git a/src/combined/combined_wavpack.h b/src/combined/combined_wavpack.h
index b7bf32acb..7688f91df 100644
--- a/src/combined/combined_wavpack.h
+++ b/src/combined/combined_wavpack.h
@@ -23,6 +23,7 @@
*/
#include "os_types.h"
+#include "bswap.h"
typedef struct {
uint32_t idcode; /* This should always be the string "wvpk" */
@@ -37,13 +38,9 @@ typedef struct {
uint32_t samples_count; /* Count of samples in the current frame */
uint32_t flags; /* Misc flags */
uint32_t decoded_crc32; /* CRC32 of the decoded data */
-} __attribute__((packed)) wvheader_t;
+} XINE_PACKED wvheader_t;
-#ifdef WORDS_BIGENDIAN
-static const uint32_t wvpk_signature = ('k' + ('p' << 8) + ('v' << 16) + ('w' << 24));
-#else
-static const uint32_t wvpk_signature = ('w' + ('v' << 8) + ('p' << 16) + ('k' << 24));
-#endif
+static const uint32_t wvpk_signature = ME_FOURCC('w', 'v', 'p', 'k');
void *demux_wv_init_plugin (xine_t *const xine, void *const data);
void *decoder_wavpack_init_plugin (xine_t *xine, void *data);
diff --git a/src/combined/decoder_flac.c b/src/combined/decoder_flac.c
index 9b77cc27d..52fbde49f 100644
--- a/src/combined/decoder_flac.c
+++ b/src/combined/decoder_flac.c
@@ -59,23 +59,17 @@ typedef struct flac_decoder_s {
int64_t pts;
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
xine_stream_t *stream;
FLAC__StreamDecoder *flac_decoder;
- int sample_rate;
- int bits_per_sample;
- int channels;
-
unsigned char *buf;
int buf_size;
int buf_pos;
int min_size;
+ int output_open;
+
} flac_decoder_t;
/*
@@ -249,21 +243,18 @@ flac_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
*/
if (buf->decoder_flags & BUF_FLAG_STDHEADER)
{
- int mode = AO_CAP_MODE_MONO;
-
- this->sample_rate = buf->decoder_info[1];
- this->bits_per_sample = buf->decoder_info[2];
- this->channels = buf->decoder_info[3];
-
- mode = _x_ao_channels2mode(this->channels);
+ const int sample_rate = buf->decoder_info[1];
+ const int bits_per_sample = buf->decoder_info[2];
+ const int channels = buf->decoder_info[3];
+ const int mode = _x_ao_channels2mode(channels);
if (!this->output_open)
{
this->output_open = this->stream->audio_out->open (
this->stream->audio_out,
this->stream,
- this->bits_per_sample,
- this->sample_rate,
+ bits_per_sample,
+ sample_rate,
mode);