aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/SndfileDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 12:11:37 +0200
committerMax Kellermann <max@duempel.org>2013-09-27 12:11:37 +0200
commitc5d05ac0cf18dbd3d04534de240c437f8b07bd28 (patch)
tree5e69c019f69cc6f2f1d99c71448338d855bf4898 /src/decoder/SndfileDecoderPlugin.cxx
parent939003c1f1a8ed9f6e3fe677a63e1686fe35d929 (diff)
downloadmpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.gz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.xz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.zip
DecoderCommand: convert to strictly-typed enum
Diffstat (limited to 'src/decoder/SndfileDecoderPlugin.cxx')
-rw-r--r--src/decoder/SndfileDecoderPlugin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder/SndfileDecoderPlugin.cxx b/src/decoder/SndfileDecoderPlugin.cxx
index 252e88df5..56853958c 100644
--- a/src/decoder/SndfileDecoderPlugin.cxx
+++ b/src/decoder/SndfileDecoderPlugin.cxx
@@ -119,7 +119,6 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
size_t frame_size;
sf_count_t read_frames, num_frames;
int buffer[4096];
- enum decoder_command cmd;
info.format = 0;
@@ -147,6 +146,7 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
frame_size = audio_format.GetFrameSize();
read_frames = sizeof(buffer) / frame_size;
+ DecoderCommand cmd;
do {
num_frames = sf_readf_int(sf, buffer, read_frames);
if (num_frames <= 0)
@@ -155,7 +155,7 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
cmd = decoder_data(decoder, is,
buffer, num_frames * frame_size,
0);
- if (cmd == DECODE_COMMAND_SEEK) {
+ if (cmd == DecoderCommand::SEEK) {
sf_count_t c =
time_to_frame(decoder_seek_where(decoder),
&audio_format);
@@ -164,9 +164,9 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_seek_error(decoder);
else
decoder_command_finished(decoder);
- cmd = DECODE_COMMAND_NONE;
+ cmd = DecoderCommand::NONE;
}
- } while (cmd == DECODE_COMMAND_NONE);
+ } while (cmd == DecoderCommand::NONE);
sf_close(sf);
}