mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
module-remap-source: Add resample_method argument
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
5f7dfd9b91
commit
3d425a3315
1 changed files with 9 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ PA_MODULE_USAGE(
|
|||
"rate=<sample rate> "
|
||||
"channels=<number of channels> "
|
||||
"channel_map=<channel map> "
|
||||
"resample_method=<resampler> "
|
||||
"remix=<remix channels?>");
|
||||
|
||||
struct userdata {
|
||||
|
|
@ -75,6 +76,7 @@ static const char* const valid_modargs[] = {
|
|||
"rate",
|
||||
"channels",
|
||||
"channel_map",
|
||||
"resample_method",
|
||||
"remix",
|
||||
NULL
|
||||
};
|
||||
|
|
@ -263,6 +265,7 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
|||
int pa__init(pa_module*m) {
|
||||
struct userdata *u;
|
||||
pa_sample_spec ss;
|
||||
pa_resample_method_t resample_method = PA_RESAMPLER_INVALID;
|
||||
pa_channel_map source_map, stream_map;
|
||||
pa_modargs *ma;
|
||||
pa_source *master;
|
||||
|
|
@ -308,6 +311,11 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_resample_method(ma, &resample_method) < 0) {
|
||||
pa_log("Invalid resampling method");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
u = pa_xnew0(struct userdata, 1);
|
||||
u->module = m;
|
||||
m->userdata = u;
|
||||
|
|
@ -364,6 +372,7 @@ int pa__init(pa_module*m) {
|
|||
pa_source_output_new_data_set_sample_spec(&source_output_data, &ss);
|
||||
pa_source_output_new_data_set_channel_map(&source_output_data, &stream_map);
|
||||
source_output_data.flags = remix ? 0 : PA_SOURCE_OUTPUT_NO_REMIX;
|
||||
source_output_data.resample_method = resample_method;
|
||||
|
||||
pa_source_output_new(&u->source_output, m->core, &source_output_data);
|
||||
pa_source_output_new_data_done(&source_output_data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue