diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 12:27:33 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-27 12:27:33 +0200 |
commit | 6765901687b1b5869e240dfa7507430ab8b6eb73 (patch) | |
tree | 4caa2e0f82fe98196684fd4da03cb0575d1d465c /src/DecoderAPI.cxx | |
parent | c5d05ac0cf18dbd3d04534de240c437f8b07bd28 (diff) | |
download | mpd-6765901687b1b5869e240dfa7507430ab8b6eb73.tar.gz mpd-6765901687b1b5869e240dfa7507430ab8b6eb73.tar.xz mpd-6765901687b1b5869e240dfa7507430ab8b6eb73.zip |
DecoderControl: convert "enum decoder_state" to strictly-typed enum
Diffstat (limited to '')
-rw-r--r-- | src/DecoderAPI.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
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 */ |