aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderThread.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/DecoderThread.cxx
parent939003c1f1a8ed9f6e3fe677a63e1686fe35d929 (diff)
downloadmpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.gz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.xz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.zip
DecoderCommand: convert to strictly-typed enum
Diffstat (limited to 'src/DecoderThread.cxx')
-rw-r--r--src/DecoderThread.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index a789cc30f..235865fd3 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -52,9 +52,9 @@
static void
decoder_command_finished_locked(struct decoder_control *dc)
{
- assert(dc->command != DECODE_COMMAND_NONE);
+ assert(dc->command != DecoderCommand::NONE);
- dc->command = DECODE_COMMAND_NONE;
+ dc->command = DecoderCommand::NONE;
dc->client_cond.signal();
}
@@ -67,7 +67,7 @@ decoder_command_finished_locked(struct decoder_control *dc)
*
* Unlock the decoder before calling this function.
*
- * @return an input_stream on success or if #DECODE_COMMAND_STOP is
+ * @return an input_stream on success or if #DecoderCommand::STOP is
* received, NULL on error
*/
static struct input_stream *
@@ -90,7 +90,7 @@ decoder_input_stream_open(struct decoder_control *dc, const char *uri)
is->Update();
while (!is->ready &&
- dc->command != DECODE_COMMAND_STOP) {
+ dc->command != DecoderCommand::STOP) {
dc->Wait();
is->Update();
@@ -124,7 +124,7 @@ decoder_stream_decode(const struct decoder_plugin *plugin,
g_debug("probing plugin %s", plugin->name);
- if (decoder->dc->command == DECODE_COMMAND_STOP)
+ if (decoder->dc->command == DecoderCommand::STOP)
return true;
/* rewind the stream, so each plugin gets a fresh start */
@@ -157,7 +157,7 @@ decoder_file_decode(const struct decoder_plugin *plugin,
g_debug("probing plugin %s", plugin->name);
- if (decoder->dc->command == DECODE_COMMAND_STOP)
+ if (decoder->dc->command == DecoderCommand::STOP)
return true;
decoder->dc->Unlock();
@@ -286,7 +286,7 @@ decoder_run_stream(struct decoder *decoder, const char *uri)
GSList *tried = NULL;
- success = dc->command == DECODE_COMMAND_STOP ||
+ success = dc->command == DecoderCommand::STOP ||
/* first we try mime types: */
decoder_run_stream_mime_type(decoder, input_stream, &tried) ||
/* if that fails, try suffix matching the URL: */
@@ -455,7 +455,7 @@ decoder_task(gpointer arg)
dc->state == DECODE_STATE_ERROR);
switch (dc->command) {
- case DECODE_COMMAND_START:
+ case DecoderCommand::START:
dc->MixRampStart(nullptr);
dc->MixRampPrevEnd(dc->mixramp_end);
dc->mixramp_end = NULL; /* Don't free, it's copied above. */
@@ -464,19 +464,19 @@ decoder_task(gpointer arg)
/* fall through */
- case DECODE_COMMAND_SEEK:
+ case DecoderCommand::SEEK:
decoder_run(dc);
break;
- case DECODE_COMMAND_STOP:
+ case DecoderCommand::STOP:
decoder_command_finished_locked(dc);
break;
- case DECODE_COMMAND_NONE:
+ case DecoderCommand::NONE:
dc->Wait();
break;
}
- } while (dc->command != DECODE_COMMAND_NONE || !dc->quit);
+ } while (dc->command != DecoderCommand::NONE || !dc->quit);
dc->Unlock();