mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
core: make sure we fix up flags/monitor flags already in pa_sink_new() instead of pa_sink_put()
This commit is contained in:
parent
3766850c8b
commit
99a6a4742f
3 changed files with 26 additions and 36 deletions
|
|
@ -174,6 +174,9 @@ pa_source* pa_source_new(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!(flags & PA_SOURCE_HW_VOLUME_CTRL))
|
||||
flags |= PA_SOURCE_DECIBEL_VOLUME;
|
||||
|
||||
s->parent.parent.free = source_free;
|
||||
s->parent.process_msg = pa_source_process_msg;
|
||||
|
||||
|
|
@ -308,20 +311,12 @@ void pa_source_put(pa_source *s) {
|
|||
pa_assert(s->rtpoll);
|
||||
pa_assert(s->thread_info.min_latency <= s->thread_info.max_latency);
|
||||
|
||||
if (!(s->flags & PA_SOURCE_HW_VOLUME_CTRL)) {
|
||||
s->flags |= PA_SOURCE_DECIBEL_VOLUME;
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
s->thread_info.soft_muted = s->muted;
|
||||
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
s->thread_info.soft_muted = s->muted;
|
||||
}
|
||||
|
||||
if (s->flags & PA_SOURCE_DECIBEL_VOLUME)
|
||||
s->n_volume_steps = PA_VOLUME_NORM+1;
|
||||
|
||||
if (s->flags & PA_SOURCE_DYNAMIC_LATENCY)
|
||||
s->fixed_latency = 0;
|
||||
else if (s->fixed_latency <= 0)
|
||||
s->fixed_latency = DEFAULT_FIXED_LATENCY;
|
||||
pa_assert((s->flags & PA_SOURCE_HW_VOLUME_CTRL) || (s->base_volume == PA_VOLUME_NORM && s->flags & PA_SOURCE_DECIBEL_VOLUME));
|
||||
pa_assert(!(s->flags & PA_SOURCE_DECIBEL_VOLUME) || s->n_volume_steps == PA_VOLUME_NORM+1);
|
||||
pa_assert(!(s->flags & PA_SOURCE_DYNAMIC_LATENCY) == (s->fixed_latency != 0));
|
||||
|
||||
pa_assert_se(source_set_state(s, PA_SOURCE_IDLE) == 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue