mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-18 06:59:57 -05:00
don't count streams using the monitor source in pa_sink_used_by(), because this would disallow suspending a sink ehn an rtp stream is connected
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1895 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
ba322a49e1
commit
55651ec215
2 changed files with 14 additions and 9 deletions
|
|
@ -119,7 +119,8 @@ char *pa_sink_list_to_string(pa_core *c) {
|
||||||
"\tmonitor source: <%u>\n"
|
"\tmonitor source: <%u>\n"
|
||||||
"\tsample spec: <%s>\n"
|
"\tsample spec: <%s>\n"
|
||||||
"\tchannel map: <%s>\n"
|
"\tchannel map: <%s>\n"
|
||||||
"\tused by: <%u>\n",
|
"\tused by: <%u>\n"
|
||||||
|
"\tlinked by: <%u>\n",
|
||||||
c->default_sink_name && !strcmp(sink->name, c->default_sink_name) ? '*' : ' ',
|
c->default_sink_name && !strcmp(sink->name, c->default_sink_name) ? '*' : ' ',
|
||||||
sink->index,
|
sink->index,
|
||||||
sink->name,
|
sink->name,
|
||||||
|
|
@ -134,7 +135,8 @@ char *pa_sink_list_to_string(pa_core *c) {
|
||||||
sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
|
sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
|
||||||
pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec),
|
pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec),
|
||||||
pa_channel_map_snprint(cm, sizeof(cm), &sink->channel_map),
|
pa_channel_map_snprint(cm, sizeof(cm), &sink->channel_map),
|
||||||
pa_sink_used_by(sink));
|
pa_sink_used_by(sink),
|
||||||
|
pa_sink_linked_by(sink));
|
||||||
|
|
||||||
if (sink->module)
|
if (sink->module)
|
||||||
pa_strbuf_printf(s, "\tmodule: <%u>\n", sink->module->index);
|
pa_strbuf_printf(s, "\tmodule: <%u>\n", sink->module->index);
|
||||||
|
|
@ -177,7 +179,8 @@ char *pa_source_list_to_string(pa_core *c) {
|
||||||
"\tlatency: <%0.0f usec>\n"
|
"\tlatency: <%0.0f usec>\n"
|
||||||
"\tsample spec: <%s>\n"
|
"\tsample spec: <%s>\n"
|
||||||
"\tchannel map: <%s>\n"
|
"\tchannel map: <%s>\n"
|
||||||
"\tused by: <%u>\n",
|
"\tused by: <%u>\n"
|
||||||
|
"\tlinked by: <%u>\n",
|
||||||
c->default_source_name && !strcmp(source->name, c->default_source_name) ? '*' : ' ',
|
c->default_source_name && !strcmp(source->name, c->default_source_name) ? '*' : ' ',
|
||||||
source->index,
|
source->index,
|
||||||
source->name,
|
source->name,
|
||||||
|
|
@ -191,7 +194,8 @@ char *pa_source_list_to_string(pa_core *c) {
|
||||||
(double) pa_source_get_latency(source),
|
(double) pa_source_get_latency(source),
|
||||||
pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
|
pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
|
||||||
pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
|
pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
|
||||||
pa_source_used_by(source));
|
pa_source_used_by(source),
|
||||||
|
pa_source_linked_by(source));
|
||||||
|
|
||||||
if (source->monitor_of)
|
if (source->monitor_of)
|
||||||
pa_strbuf_printf(s, "\tmonitor_of: <%u>\n", source->monitor_of->index);
|
pa_strbuf_printf(s, "\tmonitor_of: <%u>\n", source->monitor_of->index);
|
||||||
|
|
|
||||||
|
|
@ -775,8 +775,11 @@ unsigned pa_sink_linked_by(pa_sink *s) {
|
||||||
|
|
||||||
ret = pa_idxset_size(s->inputs);
|
ret = pa_idxset_size(s->inputs);
|
||||||
|
|
||||||
|
/* We add in the number of streams connected to us here. Please
|
||||||
|
* not the asymmmetry to pa_sink_used_by()! */
|
||||||
|
|
||||||
if (s->monitor_source)
|
if (s->monitor_source)
|
||||||
ret += pa_source_used_by(s->monitor_source);
|
ret += pa_source_linked_by(s->monitor_source);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -788,13 +791,11 @@ unsigned pa_sink_used_by(pa_sink *s) {
|
||||||
pa_assert(PA_SINK_LINKED(s->state));
|
pa_assert(PA_SINK_LINKED(s->state));
|
||||||
|
|
||||||
ret = pa_idxset_size(s->inputs);
|
ret = pa_idxset_size(s->inputs);
|
||||||
|
|
||||||
pa_assert(ret >= s->n_corked);
|
pa_assert(ret >= s->n_corked);
|
||||||
|
|
||||||
ret -= s->n_corked;
|
ret -= s->n_corked;
|
||||||
|
|
||||||
if (s->monitor_source)
|
/* Streams connected to our monitor source do not matter for
|
||||||
ret += pa_source_used_by(s->monitor_source);
|
* pa_sink_used_by()!.*/
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue