diff options
author | Max Kellermann <max@duempel.org> | 2014-05-22 11:14:01 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-22 11:14:01 +0200 |
commit | 18f39aa01216844ad37bbee59020c984fbdc308a (patch) | |
tree | 2aa0091effc8400b7f74da55e38e0125260f806a /test | |
parent | 631b6356521b6b4338e66e9b713dfb4f8a664b2f (diff) |
test/run_decoder: move the DecoderPlugin pointer out of struct Decoder
Diffstat (limited to 'test')
-rw-r--r-- | test/run_decoder.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx index c6f25b3fc..18692ac62 100644 --- a/test/run_decoder.cxx +++ b/test/run_decoder.cxx @@ -42,8 +42,6 @@ struct Decoder { const char *uri; - const struct DecoderPlugin *plugin; - bool initialized; }; @@ -203,17 +201,17 @@ int main(int argc, char **argv) decoder_plugin_init_all(); - decoder.plugin = decoder_plugin_from_name(decoder_name); - if (decoder.plugin == NULL) { + const DecoderPlugin *plugin = decoder_plugin_from_name(decoder_name); + if (plugin == nullptr) { fprintf(stderr, "No such decoder: %s\n", decoder_name); return EXIT_FAILURE; } decoder.initialized = false; - if (decoder.plugin->file_decode != NULL) { - decoder.plugin->FileDecode(decoder, Path::FromFS(decoder.uri)); - } else if (decoder.plugin->stream_decode != NULL) { + if (plugin->file_decode != nullptr) { + plugin->FileDecode(decoder, Path::FromFS(decoder.uri)); + } else if (plugin->stream_decode != nullptr) { Mutex mutex; Cond cond; @@ -228,7 +226,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - decoder.plugin->StreamDecode(decoder, *is); + plugin->StreamDecode(decoder, *is); delete is; } else { |