mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
allow clients to not specify the volume for their streams
This commit is contained in:
parent
c35d1bbec3
commit
ec62596f49
3 changed files with 29 additions and 3 deletions
|
|
@ -865,6 +865,7 @@ static int create_stream(
|
|||
|
||||
pa_tagstruct *t;
|
||||
uint32_t tag;
|
||||
pa_bool_t volume_set = FALSE;
|
||||
|
||||
pa_assert(s);
|
||||
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||
|
|
@ -957,6 +958,8 @@ static int create_stream(
|
|||
PA_TAG_U32, s->syncid,
|
||||
PA_TAG_INVALID);
|
||||
|
||||
volume_set = !!volume;
|
||||
|
||||
if (!volume)
|
||||
volume = pa_cvolume_reset(&cv, s->sample_spec.channels);
|
||||
|
||||
|
|
@ -994,6 +997,15 @@ static int create_stream(
|
|||
pa_tagstruct_putu32(t, s->direct_on_input);
|
||||
}
|
||||
|
||||
if (s->context->version >= 14 &&
|
||||
s->direction == PA_STREAM_PLAYBACK) {
|
||||
|
||||
pa_tagstruct_put(
|
||||
t,
|
||||
PA_TAG_BOOLEAN, volume_set,
|
||||
PA_TAG_INVALID);
|
||||
}
|
||||
|
||||
pa_pstream_send_tagstruct(s->context->pstream, t);
|
||||
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_create_stream_callback, s, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue