private static string iface;
private static int port;
+ private static bool no_upnp;
private static bool no_transcoding;
private static bool no_mp3_trans;
private static bool no_mp2ts_trans;
"Set plugin titles", "PluginName:TITLE" },
{ "plugin-option", 'o', 0, OptionArg.STRING_ARRAY, ref plugin_options,
"Set plugin options", "PluginName:OPTION:VALUE1[,VALUE2,..]" },
+ { "disable-upnp", 'P', 0, OptionArg.NONE, ref no_upnp,
+ "Disable UPnP (streaming-only)", null },
{ null }
};
}
}
- // Why would someone lauch rygel to kill itself?
public bool get_upnp_enabled () throws GLib.Error {
- throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
+ if (!no_upnp) {
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
+ } else {
+ return false;
+ }
}
public string get_interface () throws GLib.Error {
private static string ENABLED_KEY = "ENABLED";
private static string INTERFACE_ENV = RYGEL_PREFIX + "_IFACE";
private static string PORT_ENV = RYGEL_PREFIX + "_PORT";
+ private static string DISABLE_UPNP_ENV = RYGEL_PREFIX + "_DISABLE_UPNP";
private static string TRANSCODING_ENV = RYGEL_PREFIX + "_TRANSCODING";
private static string MP3_TRANSCODING_ENV = RYGEL_PREFIX + "_MP3_TRANS";
private static string LPCM_TRANSCODING_ENV = RYGEL_PREFIX + "_LPCM_TRANS";
return config;
}
- // This config doesn't make sense in this context.
public bool get_upnp_enabled () throws GLib.Error {
- throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
+ return !this.get_bool_variable (DISABLE_UPNP_ENV);
}
public string get_interface () throws GLib.Error {