test/run_decoder: move the DecoderPlugin pointer out of struct Decoder
This commit is contained in:
parent
631b635652
commit
18f39aa012
@ -42,8 +42,6 @@
|
|||||||
struct Decoder {
|
struct Decoder {
|
||||||
const char *uri;
|
const char *uri;
|
||||||
|
|
||||||
const struct DecoderPlugin *plugin;
|
|
||||||
|
|
||||||
bool initialized;
|
bool initialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -203,17 +201,17 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
decoder_plugin_init_all();
|
decoder_plugin_init_all();
|
||||||
|
|
||||||
decoder.plugin = decoder_plugin_from_name(decoder_name);
|
const DecoderPlugin *plugin = decoder_plugin_from_name(decoder_name);
|
||||||
if (decoder.plugin == NULL) {
|
if (plugin == nullptr) {
|
||||||
fprintf(stderr, "No such decoder: %s\n", decoder_name);
|
fprintf(stderr, "No such decoder: %s\n", decoder_name);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
decoder.initialized = false;
|
decoder.initialized = false;
|
||||||
|
|
||||||
if (decoder.plugin->file_decode != NULL) {
|
if (plugin->file_decode != nullptr) {
|
||||||
decoder.plugin->FileDecode(decoder, Path::FromFS(decoder.uri));
|
plugin->FileDecode(decoder, Path::FromFS(decoder.uri));
|
||||||
} else if (decoder.plugin->stream_decode != NULL) {
|
} else if (plugin->stream_decode != nullptr) {
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
Cond cond;
|
Cond cond;
|
||||||
|
|
||||||
@ -228,7 +226,7 @@ int main(int argc, char **argv)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
decoder.plugin->StreamDecode(decoder, *is);
|
plugin->StreamDecode(decoder, *is);
|
||||||
|
|
||||||
delete is;
|
delete is;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user