mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-03-02 01:40:27 -05:00
sink: Introduce structure needed to consolidate virtual sink code
This patch introduces the vsink structure which holds all data needed by virtual sinks. This is in preparation of the consolidation of the virtual sink code. The input_to_master field of the sink will be moved to the vsink structure after the consolidation. Until all virtual sinks are converted, sink->input_to_master and sink->vsink->input_to_master must both be supported.
This commit is contained in:
parent
ed3d4f0837
commit
d18756fda9
4 changed files with 124 additions and 11 deletions
|
|
@ -287,6 +287,7 @@ pa_sink* pa_sink_new(
|
|||
s->inputs = pa_idxset_new(NULL, NULL);
|
||||
s->n_corked = 0;
|
||||
s->input_to_master = NULL;
|
||||
s->vsink = NULL;
|
||||
|
||||
s->reference_volume = s->real_volume = data->volume;
|
||||
pa_cvolume_reset(&s->soft_volume, s->sample_spec.channels);
|
||||
|
|
@ -1692,11 +1693,19 @@ bool pa_sink_has_filter_attached(pa_sink *s) {
|
|||
pa_sink *pa_sink_get_master(pa_sink *s) {
|
||||
pa_sink_assert_ref(s);
|
||||
|
||||
/* During consolidation, we have to support s->input_to_master and
|
||||
* s->vsink->input_to_master. The first will disappear after all
|
||||
* virtual sinks use the new code. */
|
||||
while (s && (s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)) {
|
||||
if (PA_UNLIKELY(!s->input_to_master))
|
||||
if (PA_UNLIKELY(s->vsink && !s->vsink->input_to_master))
|
||||
return NULL;
|
||||
if (PA_UNLIKELY(!s->vsink && !s->input_to_master))
|
||||
return NULL;
|
||||
|
||||
s = s->input_to_master->sink;
|
||||
if (s->input_to_master)
|
||||
s = s->input_to_master->sink;
|
||||
else
|
||||
s = s->vsink->input_to_master->sink;
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
@ -1706,7 +1715,7 @@ pa_sink *pa_sink_get_master(pa_sink *s) {
|
|||
bool pa_sink_is_filter(pa_sink *s) {
|
||||
pa_sink_assert_ref(s);
|
||||
|
||||
return (s->input_to_master != NULL);
|
||||
return ((s->vsink != NULL) || (s->input_to_master != NULL));
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue