aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/VorbisDecoderPlugin.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/VorbisDecoderPlugin.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/VorbisDecoderPlugin.cxx')
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index 2b175912d..a4a938aa8 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -83,7 +83,7 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence)
Error error;
return vis->seekable &&
- (!vis->decoder || decoder_get_command(vis->decoder) != DECODE_COMMAND_STOP) &&
+ (!vis->decoder || decoder_get_command(vis->decoder) != DecoderCommand::STOP) &&
vis->input_stream->LockSeek(offset, whence, error)
? 0 : -1;
}
@@ -143,7 +143,7 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
int ret = ov_open_callbacks(vis, vf, NULL, 0, vorbis_is_callbacks);
if (ret < 0) {
if (decoder == NULL ||
- decoder_get_command(decoder) == DECODE_COMMAND_NONE)
+ decoder_get_command(decoder) == DecoderCommand::NONE)
g_warning("Failed to open Ogg Vorbis stream: %s",
vorbis_strerror(ret));
return false;
@@ -221,8 +221,6 @@ vorbis_stream_decode(struct decoder *decoder,
decoder_initialized(decoder, audio_format, vis.seekable, total_time);
- enum decoder_command cmd = decoder_get_command(decoder);
-
#ifdef HAVE_TREMOR
char buffer[4096];
#else
@@ -235,8 +233,9 @@ vorbis_stream_decode(struct decoder *decoder,
int prev_section = -1;
unsigned kbit_rate = 0;
+ DecoderCommand cmd = decoder_get_command(decoder);
do {
- if (cmd == DECODE_COMMAND_SEEK) {
+ if (cmd == DecoderCommand::SEEK) {
double seek_where = decoder_seek_where(decoder);
if (0 == ov_time_seek_page(&vf, seek_where)) {
decoder_command_finished(decoder);
@@ -302,7 +301,7 @@ vorbis_stream_decode(struct decoder *decoder,
cmd = decoder_data(decoder, input_stream,
buffer, nbytes,
kbit_rate);
- } while (cmd != DECODE_COMMAND_STOP);
+ } while (cmd != DecoderCommand::STOP);
ov_clear(&vf);
}