mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
module-combine: always use last input buffer
To handle the case where buffers are queued up because a trigger didn't complete.
This commit is contained in:
parent
cfaf424ed8
commit
b9789e36cd
1 changed files with 24 additions and 6 deletions
|
|
@ -965,8 +965,17 @@ static void combine_input_process(void *d)
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
bool delay_changed = false;
|
bool delay_changed = false;
|
||||||
|
|
||||||
if ((in = pw_stream_dequeue_buffer(impl->combine)) == NULL) {
|
in = NULL;
|
||||||
pw_log_debug("out of buffers: %m");
|
while (true) {
|
||||||
|
struct pw_buffer *t;
|
||||||
|
if ((t = pw_stream_dequeue_buffer(impl->combine)) == NULL)
|
||||||
|
break;
|
||||||
|
if (in)
|
||||||
|
pw_stream_queue_buffer(impl->combine, in);
|
||||||
|
in = t;
|
||||||
|
}
|
||||||
|
if (in == NULL) {
|
||||||
|
pw_log_debug("%p: out of input buffers: %m", impl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -980,7 +989,7 @@ static void combine_input_process(void *d)
|
||||||
delay_changed = true;
|
delay_changed = true;
|
||||||
|
|
||||||
if ((out = pw_stream_dequeue_buffer(s->stream)) == NULL) {
|
if ((out = pw_stream_dequeue_buffer(s->stream)) == NULL) {
|
||||||
pw_log_warn("out of playback buffers: %m");
|
pw_log_warn("%p: out of playback buffers: %m", s);
|
||||||
goto do_trigger;
|
goto do_trigger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1033,7 +1042,7 @@ static void combine_output_process(void *d)
|
||||||
bool delay_changed = false;
|
bool delay_changed = false;
|
||||||
|
|
||||||
if ((out = pw_stream_dequeue_buffer(impl->combine)) == NULL) {
|
if ((out = pw_stream_dequeue_buffer(impl->combine)) == NULL) {
|
||||||
pw_log_debug("out of buffers: %m");
|
pw_log_debug("%p: out of output buffers: %m", impl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1046,8 +1055,17 @@ static void combine_output_process(void *d)
|
||||||
if (check_stream_delay(s))
|
if (check_stream_delay(s))
|
||||||
delay_changed = true;
|
delay_changed = true;
|
||||||
|
|
||||||
if ((in = pw_stream_dequeue_buffer(s->stream)) == NULL) {
|
in = NULL;
|
||||||
pw_log_warn("%p: out of capture buffers: %m", s);
|
while (true) {
|
||||||
|
struct pw_buffer *t;
|
||||||
|
if ((t = pw_stream_dequeue_buffer(s->stream)) == NULL)
|
||||||
|
break;
|
||||||
|
if (in)
|
||||||
|
pw_stream_queue_buffer(s->stream, in);
|
||||||
|
in = t;
|
||||||
|
}
|
||||||
|
if (in == NULL) {
|
||||||
|
pw_log_debug("%p: out of input buffers: %m", s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
s->ready = false;
|
s->ready = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue