mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
include the name of the master sink in the name for piggy-backed virtual sinks
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1885 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
c6b43bf119
commit
6cfb09698a
2 changed files with 30 additions and 23 deletions
|
|
@ -56,8 +56,6 @@ PA_MODULE_USAGE(
|
||||||
"label=<ladspa plugin label> "
|
"label=<ladspa plugin label> "
|
||||||
"control=<comma seperated list of input control values>")
|
"control=<comma seperated list of input control values>")
|
||||||
|
|
||||||
#define DEFAULT_SINK_NAME "ladspa"
|
|
||||||
|
|
||||||
struct userdata {
|
struct userdata {
|
||||||
pa_core *core;
|
pa_core *core;
|
||||||
pa_module *module;
|
pa_module *module;
|
||||||
|
|
@ -278,6 +276,7 @@ int pa__init(pa_module*m) {
|
||||||
unsigned long input_port, output_port, p, j, n_control;
|
unsigned long input_port, output_port, p, j, n_control;
|
||||||
unsigned c;
|
unsigned c;
|
||||||
pa_bool_t *use_default = NULL;
|
pa_bool_t *use_default = NULL;
|
||||||
|
char *default_sink_name = NULL;
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -558,8 +557,10 @@ int pa__init(pa_module*m) {
|
||||||
for (c = 0; c < u->channels; c++)
|
for (c = 0; c < u->channels; c++)
|
||||||
d->activate(u->handle[c]);
|
d->activate(u->handle[c]);
|
||||||
|
|
||||||
|
default_sink_name = pa_sprintf_malloc("%s.ladspa", master->name);
|
||||||
|
|
||||||
/* Create sink */
|
/* Create sink */
|
||||||
if (!(u->sink = pa_sink_new(m->core, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, &map))) {
|
if (!(u->sink = pa_sink_new(m->core, __FILE__, pa_modargs_get_value(ma, "sink_name", default_sink_name), 0, &ss, &map))) {
|
||||||
pa_log("Failed to create sink.");
|
pa_log("Failed to create sink.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
@ -570,7 +571,7 @@ int pa__init(pa_module*m) {
|
||||||
u->sink->flags = PA_SINK_LATENCY|PA_SINK_CAN_SUSPEND;
|
u->sink->flags = PA_SINK_LATENCY|PA_SINK_CAN_SUSPEND;
|
||||||
|
|
||||||
pa_sink_set_module(u->sink, m);
|
pa_sink_set_module(u->sink, m);
|
||||||
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("LADSPA on '%s'", master->description));
|
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("LADSPA plugin '%s' on '%s'", label, master->description));
|
||||||
pa_xfree(t);
|
pa_xfree(t);
|
||||||
pa_sink_set_asyncmsgq(u->sink, master->asyncmsgq);
|
pa_sink_set_asyncmsgq(u->sink, master->asyncmsgq);
|
||||||
pa_sink_set_rtpoll(u->sink, master->rtpoll);
|
pa_sink_set_rtpoll(u->sink, master->rtpoll);
|
||||||
|
|
@ -601,6 +602,7 @@ int pa__init(pa_module*m) {
|
||||||
pa_modargs_free(ma);
|
pa_modargs_free(ma);
|
||||||
|
|
||||||
pa_xfree(use_default);
|
pa_xfree(use_default);
|
||||||
|
pa_xfree(default_sink_name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
@ -609,6 +611,7 @@ fail:
|
||||||
pa_modargs_free(ma);
|
pa_modargs_free(ma);
|
||||||
|
|
||||||
pa_xfree(use_default);
|
pa_xfree(use_default);
|
||||||
|
pa_xfree(default_sink_name);
|
||||||
|
|
||||||
pa__done(m);
|
pa__done(m);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,6 @@ PA_MODULE_USAGE(
|
||||||
"rate=<sample rate> "
|
"rate=<sample rate> "
|
||||||
"channel_map=<channel map>")
|
"channel_map=<channel map>")
|
||||||
|
|
||||||
#define DEFAULT_SINK_NAME "remapped"
|
|
||||||
|
|
||||||
struct userdata {
|
struct userdata {
|
||||||
pa_core *core;
|
pa_core *core;
|
||||||
pa_module *module;
|
pa_module *module;
|
||||||
|
|
@ -214,6 +212,7 @@ int pa__init(pa_module*m) {
|
||||||
char *t;
|
char *t;
|
||||||
pa_sink *master;
|
pa_sink *master;
|
||||||
pa_sink_input_new_data data;
|
pa_sink_input_new_data data;
|
||||||
|
char *default_sink_name = NULL;
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -252,8 +251,10 @@ int pa__init(pa_module*m) {
|
||||||
u->master = master;
|
u->master = master;
|
||||||
pa_memchunk_reset(&u->memchunk);
|
pa_memchunk_reset(&u->memchunk);
|
||||||
|
|
||||||
|
default_sink_name = pa_sprintf_malloc("%s.remapped", master->name);
|
||||||
|
|
||||||
/* Create sink */
|
/* Create sink */
|
||||||
if (!(u->sink = pa_sink_new(m->core, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, &sink_map))) {
|
if (!(u->sink = pa_sink_new(m->core, __FILE__, pa_modargs_get_value(ma, "sink_name", default_sink_name), 0, &ss, &sink_map))) {
|
||||||
pa_log("Failed to create sink.");
|
pa_log("Failed to create sink.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +265,7 @@ int pa__init(pa_module*m) {
|
||||||
u->sink->flags = PA_SINK_LATENCY|PA_SINK_CAN_SUSPEND;
|
u->sink->flags = PA_SINK_LATENCY|PA_SINK_CAN_SUSPEND;
|
||||||
|
|
||||||
pa_sink_set_module(u->sink, m);
|
pa_sink_set_module(u->sink, m);
|
||||||
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Remapped sink of '%s'", master->description));
|
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Remapped %s", master->description));
|
||||||
pa_xfree(t);
|
pa_xfree(t);
|
||||||
pa_sink_set_asyncmsgq(u->sink, master->asyncmsgq);
|
pa_sink_set_asyncmsgq(u->sink, master->asyncmsgq);
|
||||||
pa_sink_set_rtpoll(u->sink, master->rtpoll);
|
pa_sink_set_rtpoll(u->sink, master->rtpoll);
|
||||||
|
|
@ -273,7 +274,7 @@ int pa__init(pa_module*m) {
|
||||||
pa_sink_input_new_data_init(&data);
|
pa_sink_input_new_data_init(&data);
|
||||||
data.sink = u->master;
|
data.sink = u->master;
|
||||||
data.driver = __FILE__;
|
data.driver = __FILE__;
|
||||||
data.name = "Remapped stream";
|
data.name = "Remapped Stream";
|
||||||
pa_sink_input_new_data_set_sample_spec(&data, &ss);
|
pa_sink_input_new_data_set_sample_spec(&data, &ss);
|
||||||
pa_sink_input_new_data_set_channel_map(&data, &stream_map);
|
pa_sink_input_new_data_set_channel_map(&data, &stream_map);
|
||||||
data.module = m;
|
data.module = m;
|
||||||
|
|
@ -293,6 +294,7 @@ int pa__init(pa_module*m) {
|
||||||
pa_sink_input_put(u->sink_input);
|
pa_sink_input_put(u->sink_input);
|
||||||
|
|
||||||
pa_modargs_free(ma);
|
pa_modargs_free(ma);
|
||||||
|
pa_xfree(default_sink_name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
@ -302,6 +304,8 @@ fail:
|
||||||
|
|
||||||
pa__done(m);
|
pa__done(m);
|
||||||
|
|
||||||
|
pa_xfree(default_sink_name);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue