diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 12:11:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-27 12:11:37 +0200 |
commit | c5d05ac0cf18dbd3d04534de240c437f8b07bd28 (patch) | |
tree | 5e69c019f69cc6f2f1d99c71448338d855bf4898 /src/decoder/FlacDecoderPlugin.cxx | |
parent | 939003c1f1a8ed9f6e3fe677a63e1686fe35d929 (diff) | |
download | mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.gz mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.xz mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.zip |
DecoderCommand: convert to strictly-typed enum
Diffstat (limited to 'src/decoder/FlacDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/FlacDecoderPlugin.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder/FlacDecoderPlugin.cxx b/src/decoder/FlacDecoderPlugin.cxx index c5dd03665..a6b10fbe2 100644 --- a/src/decoder/FlacDecoderPlugin.cxx +++ b/src/decoder/FlacDecoderPlugin.cxx @@ -168,11 +168,11 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec, FLAC__uint64 t_start, FLAC__uint64 t_end) { struct decoder *decoder = data->decoder; - enum decoder_command cmd; data->first_frame = t_start; while (true) { + DecoderCommand cmd; if (!data->tag.IsEmpty()) { cmd = decoder_tag(data->decoder, data->input_stream, std::move(data->tag)); @@ -180,7 +180,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec, } else cmd = decoder_get_command(decoder); - if (cmd == DECODE_COMMAND_SEEK) { + if (cmd == DecoderCommand::SEEK) { FLAC__uint64 seek_sample = t_start + decoder_seek_where(decoder) * data->audio_format.sample_rate; @@ -192,7 +192,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec, decoder_command_finished(decoder); } else decoder_seek_error(decoder); - } else if (cmd == DECODE_COMMAND_STOP || + } else if (cmd == DecoderCommand::STOP || FLAC__stream_decoder_get_state(flac_dec) == FLAC__STREAM_DECODER_END_OF_STREAM) break; @@ -201,7 +201,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec, break; if (!FLAC__stream_decoder_process_single(flac_dec) && - decoder_get_command(decoder) == DECODE_COMMAND_NONE) { + decoder_get_command(decoder) == DecoderCommand::NONE) { /* a failure that was not triggered by a decoder command */ flacPrintErroredState(FLAC__stream_decoder_get_state(flac_dec)); |