mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
don't rely on PA_SINK_RUNNING vs. PA_SINK_IDLE for optimizations since it might not be fully up to date
This commit is contained in:
parent
d1cf0e7845
commit
06de6393d1
2 changed files with 4 additions and 12 deletions
|
|
@ -642,7 +642,7 @@ void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result) {
|
||||||
|
|
||||||
pa_assert(length > 0);
|
pa_assert(length > 0);
|
||||||
|
|
||||||
n = s->thread_info.state == PA_SINK_RUNNING ? fill_mix_info(s, &length, info, MAX_MIX_CHANNELS) : 0;
|
n = fill_mix_info(s, &length, info, MAX_MIX_CHANNELS);
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
|
|
||||||
|
|
@ -685,7 +685,6 @@ void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result) {
|
||||||
result->index = 0;
|
result->index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->thread_info.state == PA_SINK_RUNNING)
|
|
||||||
inputs_drop(s, info, n, result);
|
inputs_drop(s, info, n, result);
|
||||||
|
|
||||||
pa_sink_unref(s);
|
pa_sink_unref(s);
|
||||||
|
|
@ -716,7 +715,7 @@ void pa_sink_render_into(pa_sink*s, pa_memchunk *target) {
|
||||||
|
|
||||||
pa_assert(length > 0);
|
pa_assert(length > 0);
|
||||||
|
|
||||||
n = s->thread_info.state == PA_SINK_RUNNING ? fill_mix_info(s, &length, info, MAX_MIX_CHANNELS) : 0;
|
n = fill_mix_info(s, &length, info, MAX_MIX_CHANNELS);
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
if (target->length > length)
|
if (target->length > length)
|
||||||
|
|
@ -765,7 +764,6 @@ void pa_sink_render_into(pa_sink*s, pa_memchunk *target) {
|
||||||
pa_memblock_release(target->memblock);
|
pa_memblock_release(target->memblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->thread_info.state == PA_SINK_RUNNING)
|
|
||||||
inputs_drop(s, info, n, target);
|
inputs_drop(s, info, n, target);
|
||||||
|
|
||||||
pa_sink_unref(s);
|
pa_sink_unref(s);
|
||||||
|
|
|
||||||
|
|
@ -429,9 +429,6 @@ void pa_source_post(pa_source*s, const pa_memchunk *chunk) {
|
||||||
pa_assert(PA_SOURCE_IS_OPENED(s->thread_info.state));
|
pa_assert(PA_SOURCE_IS_OPENED(s->thread_info.state));
|
||||||
pa_assert(chunk);
|
pa_assert(chunk);
|
||||||
|
|
||||||
if (s->thread_info.state != PA_SOURCE_RUNNING)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&s->thread_info.soft_volume)) {
|
if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&s->thread_info.soft_volume)) {
|
||||||
pa_memchunk vchunk = *chunk;
|
pa_memchunk vchunk = *chunk;
|
||||||
|
|
||||||
|
|
@ -470,9 +467,6 @@ void pa_source_post_direct(pa_source*s, pa_source_output *o, const pa_memchunk *
|
||||||
pa_assert(o->thread_info.direct_on_input);
|
pa_assert(o->thread_info.direct_on_input);
|
||||||
pa_assert(chunk);
|
pa_assert(chunk);
|
||||||
|
|
||||||
if (s->thread_info.state != PA_SOURCE_RUNNING)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&s->thread_info.soft_volume)) {
|
if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&s->thread_info.soft_volume)) {
|
||||||
pa_memchunk vchunk = *chunk;
|
pa_memchunk vchunk = *chunk;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue