From 6765901687b1b5869e240dfa7507430ab8b6eb73 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Sep 2013 12:27:33 +0200 Subject: DecoderControl: convert "enum decoder_state" to strictly-typed enum --- src/DecoderAPI.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/DecoderAPI.cxx') diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx index 06313c909..b5f1edf76 100644 --- a/src/DecoderAPI.cxx +++ b/src/DecoderAPI.cxx @@ -47,7 +47,7 @@ decoder_initialized(struct decoder *decoder, struct decoder_control *dc = decoder->dc; struct audio_format_string af_string; - assert(dc->state == DECODE_STATE_START); + assert(dc->state == DecoderState::START); assert(dc->pipe != NULL); assert(decoder != NULL); assert(decoder->stream_tag == NULL); @@ -63,7 +63,7 @@ decoder_initialized(struct decoder *decoder, dc->total_time = total_time; dc->Lock(); - dc->state = DECODE_STATE_DECODE; + dc->state = DecoderState::DECODE; dc->client_cond.signal(); dc->Unlock(); @@ -88,7 +88,7 @@ decoder_prepare_initial_seek(struct decoder *decoder) const struct decoder_control *dc = decoder->dc; assert(dc->pipe != NULL); - if (dc->state != DECODE_STATE_DECODE) + if (dc->state != DecoderState::DECODE) /* wait until the decoder has finished initialisation (reading file headers etc.) before emitting the virtual "SEEK" command */ @@ -247,7 +247,7 @@ decoder_check_cancel_read(const struct decoder *decoder) /* ignore the SEEK command during initialization, the plugin should handle that after it has initialized successfully */ if (dc->command == DecoderCommand::SEEK && - (dc->state == DECODE_STATE_START || decoder->seeking)) + (dc->state == DecoderState::START || decoder->seeking)) return false; return true; @@ -260,8 +260,8 @@ size_t decoder_read(struct decoder *decoder, /* XXX don't allow decoder==NULL */ assert(decoder == NULL || - decoder->dc->state == DECODE_STATE_START || - decoder->dc->state == DECODE_STATE_DECODE); + decoder->dc->state == DecoderState::START || + decoder->dc->state == DecoderState::DECODE); assert(is != NULL); assert(buffer != NULL); @@ -364,7 +364,7 @@ decoder_data(struct decoder *decoder, struct decoder_control *dc = decoder->dc; DecoderCommand cmd; - assert(dc->state == DECODE_STATE_DECODE); + assert(dc->state == DecoderState::DECODE); assert(dc->pipe != NULL); assert(length % dc->in_audio_format.GetFrameSize() == 0); @@ -472,7 +472,7 @@ decoder_tag(gcc_unused struct decoder *decoder, struct input_stream *is, gcc_unused const struct decoder_control *dc = decoder->dc; DecoderCommand cmd; - assert(dc->state == DECODE_STATE_DECODE); + assert(dc->state == DecoderState::DECODE); assert(dc->pipe != NULL); /* save the tag */ -- cgit v1.2.3