aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/plugins/FfmpegInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-03-02 00:17:32 +0100
committerMax Kellermann <max@duempel.org>2014-03-02 00:17:32 +0100
commit2bf2f34b1211bfde95ef4ada77147a8b65830084 (patch)
treea6e639ccd3d07d445968f888e59bab580981ce89 /src/input/plugins/FfmpegInputPlugin.cxx
parent7453c26ec4838760dec767b2f99afff9eb537d53 (diff)
downloadmpd-2bf2f34b1211bfde95ef4ada77147a8b65830084.tar.gz
mpd-2bf2f34b1211bfde95ef4ada77147a8b65830084.tar.xz
mpd-2bf2f34b1211bfde95ef4ada77147a8b65830084.zip
InputPlugin: allow init() to soft-fail
Add enum InputResult which is a tri-state. Input plugins may now fail and just become unavailable.
Diffstat (limited to 'src/input/plugins/FfmpegInputPlugin.cxx')
-rw-r--r--src/input/plugins/FfmpegInputPlugin.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input/plugins/FfmpegInputPlugin.cxx b/src/input/plugins/FfmpegInputPlugin.cxx
index 0d0a4375e..dab4b59fb 100644
--- a/src/input/plugins/FfmpegInputPlugin.cxx
+++ b/src/input/plugins/FfmpegInputPlugin.cxx
@@ -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 &param,
Error &error)
{
@@ -78,10 +78,10 @@ input_ffmpeg_init(gcc_unused const config_param &param,
/* 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 *