mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
virtual-sink: Add a modarg for forcing flat volume.
This commit is contained in:
parent
8702d15d03
commit
d2d36beb80
1 changed files with 15 additions and 1 deletions
|
|
@ -58,6 +58,7 @@ PA_MODULE_USAGE(
|
|||
"channels=<number of channels> "
|
||||
"channel_map=<channel map> "
|
||||
"use_volume_sharing=<yes or no> "
|
||||
"force_flat_volume=<yes or no> "
|
||||
));
|
||||
|
||||
#define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
|
||||
|
|
@ -83,6 +84,7 @@ static const char* const valid_modargs[] = {
|
|||
"channels",
|
||||
"channel_map",
|
||||
"use_volume_sharing",
|
||||
"force_flat_volume",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -481,6 +483,7 @@ int pa__init(pa_module*m) {
|
|||
pa_sink_new_data sink_data;
|
||||
pa_bool_t *use_default = NULL;
|
||||
pa_bool_t use_volume_sharing = FALSE;
|
||||
pa_bool_t force_flat_volume = FALSE;
|
||||
|
||||
pa_assert(m);
|
||||
|
||||
|
|
@ -509,6 +512,16 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "force_flat_volume", &force_flat_volume) < 0) {
|
||||
pa_log("force_flat_volume= expects a boolean argument");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (use_volume_sharing && force_flat_volume) {
|
||||
pa_log("Flat volume can't be forced when using volume sharing.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
u = pa_xnew0(struct userdata, 1);
|
||||
u->module = m;
|
||||
m->userdata = u;
|
||||
|
|
@ -540,7 +553,8 @@ int pa__init(pa_module*m) {
|
|||
}
|
||||
|
||||
u->sink = pa_sink_new(m->core, &sink_data, (master->flags & (PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY))
|
||||
| (use_volume_sharing ? PA_SINK_SHARE_VOLUME_WITH_MASTER : 0));
|
||||
| (use_volume_sharing ? PA_SINK_SHARE_VOLUME_WITH_MASTER : 0)
|
||||
| (force_flat_volume ? PA_SINK_FLAT_VOLUME : 0));
|
||||
pa_sink_new_data_done(&sink_data);
|
||||
|
||||
if (!u->sink) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue