summaryrefslogtreecommitdiff
path: root/src/libFLAC/stream_decoder.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-03-20 19:28:41 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-03-20 19:28:41 +1100
commit1be4f9537e306931a3c2115f9cfedc325fdef4e7 (patch)
tree1113c4bcc9f0dadfaf6b143234fa240835fea924 /src/libFLAC/stream_decoder.c
parenteae85ee7665d4d8604617d7bfb6529d112e7db91 (diff)
downloadflac-1be4f9537e306931a3c2115f9cfedc325fdef4e7.tar.gz
libFLAC: Reduce FLAC__HAS_OGG #ifdef crud
Diffstat (limited to 'src/libFLAC/stream_decoder.c')
-rw-r--r--src/libFLAC/stream_decoder.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index bd9f9a6e..9c1f14e9 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -56,13 +56,7 @@
/* technically this should be in an "export.c" but this is convenient enough */
-FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC =
-#if FLAC__HAS_OGG
- 1
-#else
- 0
-#endif
-;
+FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC = FLAC__HAS_OGG;
/***********************************************************************
@@ -125,9 +119,7 @@ static FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *decoder, void *c
***********************************************************************/
typedef struct FLAC__StreamDecoderPrivate {
-#if FLAC__HAS_OGG
FLAC__bool is_ogg;
-#endif
FLAC__StreamDecoderReadCallback read_callback;
FLAC__StreamDecoderSeekCallback seek_callback;
FLAC__StreamDecoderTellCallback tell_callback;
@@ -174,9 +166,7 @@ typedef struct FLAC__StreamDecoderPrivate {
FLAC__uint64 first_frame_offset; /* hint to the seek routine of where in the stream the first audio frame starts */
FLAC__uint64 target_sample;
unsigned unparseable_frame_count; /* used to tell whether we're decoding a future version of FLAC or just got a bad sync */
-#if FLAC__HAS_OGG
FLAC__bool got_a_frame; /* hack needed in Ogg FLAC seek routine to check when process_single() actually writes a frame */
-#endif
} FLAC__StreamDecoderPrivate;
/***********************************************************************
@@ -362,10 +352,8 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_(
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED;
-#if !FLAC__HAS_OGG
- if(is_ogg)
+ if(!FLAC__HAS_OGG == 0 && is_ogg)
return FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER;
-#endif
if(
0 == read_callback ||
@@ -914,10 +902,9 @@ FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamD
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != position);
-#if FLAC__HAS_OGG
- if(decoder->private_->is_ogg)
+ if(FLAC__HAS_OGG && decoder->private_->is_ogg)
return false;
-#endif
+
if(0 == decoder->private_->tell_callback)
return false;
if(decoder->private_->tell_callback(decoder, position, decoder->private_->client_data) != FLAC__STREAM_DECODER_TELL_STATUS_OK)
@@ -1234,9 +1221,7 @@ unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecod
void set_defaults_(FLAC__StreamDecoder *decoder)
{
-#if FLAC__HAS_OGG
decoder->private_->is_ogg = false;
-#endif
decoder->private_->read_callback = 0;
decoder->private_->seek_callback = 0;
decoder->private_->tell_callback = 0;