mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-17 22:05:34 -05:00
source: Remove output_from_master field
The only source still using the output_from_master field of the source structure was module-echo-cancel. Due to the differences between the echo-cancel source and the other virtual sources, consolidation did not seem useful. To faciliate removing the output_from_master field from the source, a dummy vsource structure was created for module-echo-cancel. After that, the output_from_master field was removed.
This commit is contained in:
parent
5d05301663
commit
664d175da8
7 changed files with 27 additions and 64 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "echo-cancel.h"
|
||||
|
||||
#include <modules/virtual-sink-common.h>
|
||||
#include <modules/virtual-source-common.h>
|
||||
|
||||
#include <pulse/xmalloc.h>
|
||||
#include <pulse/timeval.h>
|
||||
|
|
@ -222,6 +223,7 @@ struct userdata {
|
|||
pa_rtpoll_item *rtpoll_item_read, *rtpoll_item_write;
|
||||
|
||||
pa_source *source;
|
||||
pa_vsource *vsource;
|
||||
bool source_auto_desc;
|
||||
pa_source_output *source_output;
|
||||
pa_memblockq *source_memblockq; /* echo canceller needs fixed sized chunks */
|
||||
|
|
@ -1731,6 +1733,10 @@ int pa__init(pa_module*m) {
|
|||
|
||||
pa_source_set_asyncmsgq(u->source, source_master->asyncmsgq);
|
||||
|
||||
/* Create vsource structure. Only needed for output_from_master field, otherwise
|
||||
* unused because the virtual source here is too different from other filters */
|
||||
u->vsource = pa_virtual_source_vsource_new(u->source);
|
||||
|
||||
/* Create sink */
|
||||
pa_sink_new_data_init(&sink_data);
|
||||
sink_data.driver = __FILE__;
|
||||
|
|
@ -1817,7 +1823,7 @@ int pa__init(pa_module*m) {
|
|||
u->source_output->moving = source_output_moving_cb;
|
||||
u->source_output->userdata = u;
|
||||
|
||||
u->source->output_from_master = u->source_output;
|
||||
u->vsource->output_from_master = u->source_output;
|
||||
|
||||
/* Create sink input */
|
||||
pa_sink_input_new_data_init(&sink_input_data);
|
||||
|
|
@ -1987,6 +1993,9 @@ void pa__done(pa_module*m) {
|
|||
if (u->vsink)
|
||||
pa_xfree(u->vsink);
|
||||
|
||||
if (u->vsource)
|
||||
pa_xfree(u->vsource);
|
||||
|
||||
if (u->source)
|
||||
pa_source_unref(u->source);
|
||||
if (u->sink)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue