waveout: add argument deprecation error

This commit is contained in:
Moritz Bruder 2017-03-01 19:29:53 +01:00 committed by Tanu Kaskinen
parent 7259df9590
commit 48ba5e4957

View file

@ -58,7 +58,9 @@ PA_MODULE_USAGE(
"channels=<number of channels> " "channels=<number of channels> "
"channel_map=<channel map> " "channel_map=<channel map> "
"fragments=<number of fragments> " "fragments=<number of fragments> "
"fragment_size=<fragment size>"); "fragment_size=<fragment size>"
"device=<device number - deprecated>"
"device_name=<name of the device - deprecated>");
#define DEFAULT_SINK_NAME "wave_output" #define DEFAULT_SINK_NAME "wave_output"
#define DEFAULT_SOURCE_NAME "wave_input" #define DEFAULT_SOURCE_NAME "wave_input"
@ -107,6 +109,8 @@ static const char* const valid_modargs[] = {
"rate", "rate",
"channels", "channels",
"channel_map", "channel_map",
"device",
"device_name",
NULL NULL
}; };
@ -521,6 +525,12 @@ int pa__init(pa_module *m) {
goto fail; goto fail;
} }
/* Check whether deprecated arguments have been used. */
if (pa_modargs_get_value(ma, "device", NULL) != NULL || pa_modargs_get_value(ma, "device_name", NULL) != NULL) {
pa_log("device and device_name are no longer supported. Please use input_device, input_device_name, output_device and output_device_name.");
goto fail;
}
if (pa_modargs_get_value_boolean(ma, "record", &record) < 0 || pa_modargs_get_value_boolean(ma, "playback", &playback) < 0) { if (pa_modargs_get_value_boolean(ma, "record", &record) < 0 || pa_modargs_get_value_boolean(ma, "playback", &playback) < 0) {
pa_log("record= and playback= expect boolean argument."); pa_log("record= and playback= expect boolean argument.");
goto fail; goto fail;