InputPlugin: allow init() to soft-fail
Add enum InputResult which is a tri-state. Input plugins may now fail and just become unavailable.
This commit is contained in:
@@ -69,7 +69,7 @@ input_ffmpeg_supported(void)
|
||||
return avio_enum_protocols(&opaque, 0) != nullptr;
|
||||
}
|
||||
|
||||
static bool
|
||||
static InputPlugin::InitResult
|
||||
input_ffmpeg_init(gcc_unused const config_param ¶m,
|
||||
Error &error)
|
||||
{
|
||||
@@ -78,10 +78,10 @@ input_ffmpeg_init(gcc_unused const config_param ¶m,
|
||||
/* disable this plugin if there's no registered protocol */
|
||||
if (!input_ffmpeg_supported()) {
|
||||
error.Set(ffmpeg_domain, "No protocol");
|
||||
return false;
|
||||
return InputPlugin::InitResult::UNAVAILABLE;
|
||||
}
|
||||
|
||||
return true;
|
||||
return InputPlugin::InitResult::SUCCESS;
|
||||
}
|
||||
|
||||
static InputStream *
|
||||
|
||||
Reference in New Issue
Block a user