aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/Mpg123DecoderPlugin.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/Mpg123DecoderPlugin.cxx
parent939003c1f1a8ed9f6e3fe677a63e1686fe35d929 (diff)
downloadmpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.gz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.xz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.zip
DecoderCommand: convert to strictly-typed enum
Diffstat (limited to '')
-rw-r--r--src/decoder/Mpg123DecoderPlugin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder/Mpg123DecoderPlugin.cxx b/src/decoder/Mpg123DecoderPlugin.cxx
index a44fc1241..3100a0f1c 100644
--- a/src/decoder/Mpg123DecoderPlugin.cxx
+++ b/src/decoder/Mpg123DecoderPlugin.cxx
@@ -106,7 +106,6 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
mpg123_handle *handle;
int error;
off_t num_samples;
- enum decoder_command cmd;
struct mpg123_frameinfo info;
/* open the file */
@@ -149,6 +148,7 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
/* the decoder main loop */
+ DecoderCommand cmd;
do {
unsigned char buffer[8192];
size_t nbytes;
@@ -175,7 +175,7 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
cmd = decoder_data(decoder, nullptr, buffer, nbytes, info.bitrate);
- if (cmd == DECODE_COMMAND_SEEK) {
+ if (cmd == DecoderCommand::SEEK) {
off_t c = decoder_seek_where(decoder)*audio_format.sample_rate;
c = mpg123_seek(handle, c, SEEK_SET);
if (c < 0)
@@ -185,9 +185,9 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
decoder_timestamp(decoder, c/(double)audio_format.sample_rate);
}
- cmd = DECODE_COMMAND_NONE;
+ cmd = DecoderCommand::NONE;
}
- } while (cmd == DECODE_COMMAND_NONE);
+ } while (cmd == DecoderCommand::NONE);
/* cleanup */