mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-23 01:40:21 -05:00
volume: Rename 'sync volume' to 'deferred volume'.
This just covers Lennart's concern over the terminology used. The majority of this change is simply the following command: grep -rli sync[-_]volume . | xargs sed -i 's/sync_volume/deferred_volume/g;s/PA_SINK_SYNC_VOLUME/PA_SINK_DEFERRED_VOLUME/g;s/PA_SOURCE_SYNC_VOLUME/PA_SOURCE_DEFERRED_VOLUME/g;s/sync-volume/deferred-volume/g' Some minor tweaks were added on top to tidy up formatting and a couple of phrases were clarified too.
This commit is contained in:
parent
83577aa373
commit
aa3142ab20
20 changed files with 143 additions and 141 deletions
|
|
@ -113,8 +113,8 @@ pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
|||
c->default_n_fragments = 4;
|
||||
c->default_fragment_size_msec = 25;
|
||||
|
||||
c->sync_volume_safety_margin_usec = 8000;
|
||||
c->sync_volume_extra_delay_usec = 0;
|
||||
c->deferred_volume_safety_margin_usec = 8000;
|
||||
c->deferred_volume_extra_delay_usec = 0;
|
||||
|
||||
c->module_defer_unload_event = NULL;
|
||||
c->scache_auto_unload_event = NULL;
|
||||
|
|
@ -140,7 +140,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
|||
c->realtime_priority = 5;
|
||||
c->disable_remixing = FALSE;
|
||||
c->disable_lfe_remixing = FALSE;
|
||||
c->sync_volume = TRUE;
|
||||
c->deferred_volume = TRUE;
|
||||
c->resample_method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
|
||||
|
||||
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ struct pa_core {
|
|||
pa_channel_map default_channel_map;
|
||||
pa_sample_spec default_sample_spec;
|
||||
unsigned default_n_fragments, default_fragment_size_msec;
|
||||
unsigned sync_volume_safety_margin_usec;
|
||||
int sync_volume_extra_delay_usec;
|
||||
unsigned deferred_volume_safety_margin_usec;
|
||||
int deferred_volume_extra_delay_usec;
|
||||
|
||||
pa_defer_event *module_defer_unload_event;
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ struct pa_core {
|
|||
pa_bool_t realtime_scheduling:1;
|
||||
pa_bool_t disable_remixing:1;
|
||||
pa_bool_t disable_lfe_remixing:1;
|
||||
pa_bool_t sync_volume:1;
|
||||
pa_bool_t deferred_volume:1;
|
||||
|
||||
pa_resample_method_t resample_method;
|
||||
int realtime_priority;
|
||||
|
|
|
|||
|
|
@ -343,8 +343,8 @@ pa_sink* pa_sink_new(
|
|||
PA_LLIST_HEAD_INIT(pa_sink_volume_change, s->thread_info.volume_changes);
|
||||
s->thread_info.volume_changes_tail = NULL;
|
||||
pa_sw_cvolume_multiply(&s->thread_info.current_hw_volume, &s->soft_volume, &s->real_volume);
|
||||
s->thread_info.volume_change_safety_margin = core->sync_volume_safety_margin_usec;
|
||||
s->thread_info.volume_change_extra_delay = core->sync_volume_extra_delay_usec;
|
||||
s->thread_info.volume_change_safety_margin = core->deferred_volume_safety_margin_usec;
|
||||
s->thread_info.volume_change_extra_delay = core->deferred_volume_extra_delay_usec;
|
||||
|
||||
/* FIXME: This should probably be moved to pa_sink_put() */
|
||||
pa_assert_se(pa_idxset_put(core->sinks, s, &s->index) >= 0);
|
||||
|
|
@ -495,9 +495,9 @@ void pa_sink_set_write_volume_callback(pa_sink *s, pa_sink_cb_t cb) {
|
|||
flags = s->flags;
|
||||
|
||||
if (cb)
|
||||
s->flags |= PA_SINK_SYNC_VOLUME;
|
||||
s->flags |= PA_SINK_DEFERRED_VOLUME;
|
||||
else
|
||||
s->flags &= ~PA_SINK_SYNC_VOLUME;
|
||||
s->flags &= ~PA_SINK_DEFERRED_VOLUME;
|
||||
|
||||
/* If the flags have changed after init, let any clients know via a change event */
|
||||
if (s->state != PA_SINK_INIT && flags != s->flags)
|
||||
|
|
@ -595,7 +595,7 @@ void pa_sink_put(pa_sink* s) {
|
|||
* Note: All of these flags set here can change over the life time
|
||||
* of the sink. */
|
||||
pa_assert(!(s->flags & PA_SINK_HW_VOLUME_CTRL) || s->set_volume);
|
||||
pa_assert(!(s->flags & PA_SINK_SYNC_VOLUME) || s->write_volume);
|
||||
pa_assert(!(s->flags & PA_SINK_DEFERRED_VOLUME) || s->write_volume);
|
||||
pa_assert(!(s->flags & PA_SINK_HW_MUTE_CTRL) || s->set_mute);
|
||||
|
||||
/* XXX: Currently decibel volume is disabled for all sinks that use volume
|
||||
|
|
@ -919,7 +919,7 @@ void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
|
|||
|
||||
if (nbytes > 0) {
|
||||
pa_log_debug("Processing rewind...");
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME)
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME)
|
||||
pa_sink_volume_change_rewind(s, nbytes);
|
||||
}
|
||||
|
||||
|
|
@ -1876,7 +1876,7 @@ void pa_sink_set_volume(
|
|||
* apply one to root_sink->soft_volume */
|
||||
|
||||
pa_cvolume_reset(&root_sink->soft_volume, root_sink->sample_spec.channels);
|
||||
if (!(root_sink->flags & PA_SINK_SYNC_VOLUME))
|
||||
if (!(root_sink->flags & PA_SINK_DEFERRED_VOLUME))
|
||||
root_sink->set_volume(root_sink);
|
||||
|
||||
} else
|
||||
|
|
@ -1896,7 +1896,7 @@ void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert(!(s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER));
|
||||
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME)
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME)
|
||||
pa_sink_assert_io_context(s);
|
||||
else
|
||||
pa_assert_ctl_context();
|
||||
|
|
@ -1906,7 +1906,7 @@ void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume) {
|
|||
else
|
||||
s->soft_volume = *volume;
|
||||
|
||||
if (PA_SINK_IS_LINKED(s->state) && !(s->flags & PA_SINK_SYNC_VOLUME))
|
||||
if (PA_SINK_IS_LINKED(s->state) && !(s->flags & PA_SINK_DEFERRED_VOLUME))
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_VOLUME, NULL, 0, NULL) == 0);
|
||||
else
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
|
|
@ -1999,7 +1999,7 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *s, pa_bool_t force_refresh) {
|
|||
|
||||
old_real_volume = s->real_volume;
|
||||
|
||||
if (!(s->flags & PA_SINK_SYNC_VOLUME) && s->get_volume)
|
||||
if (!(s->flags & PA_SINK_DEFERRED_VOLUME) && s->get_volume)
|
||||
s->get_volume(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_VOLUME, NULL, 0, NULL) == 0);
|
||||
|
|
@ -2040,7 +2040,7 @@ void pa_sink_set_mute(pa_sink *s, pa_bool_t mute, pa_bool_t save) {
|
|||
s->muted = mute;
|
||||
s->save_muted = (old_muted == s->muted && s->save_muted) || save;
|
||||
|
||||
if (!(s->flags & PA_SINK_SYNC_VOLUME) && s->set_mute)
|
||||
if (!(s->flags & PA_SINK_DEFERRED_VOLUME) && s->set_mute)
|
||||
s->set_mute(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
|
||||
|
|
@ -2059,7 +2059,7 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
|
|||
if (s->refresh_muted || force_refresh) {
|
||||
pa_bool_t old_muted = s->muted;
|
||||
|
||||
if (!(s->flags & PA_SINK_SYNC_VOLUME) && s->get_mute)
|
||||
if (!(s->flags & PA_SINK_DEFERRED_VOLUME) && s->get_mute)
|
||||
s->get_mute(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
|
||||
|
|
@ -2455,7 +2455,7 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
|
||||
case PA_SINK_MESSAGE_SET_VOLUME_SYNCED:
|
||||
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME) {
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME) {
|
||||
s->set_volume(s);
|
||||
pa_sink_volume_change_push(s);
|
||||
}
|
||||
|
|
@ -2476,7 +2476,7 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
|
||||
case PA_SINK_MESSAGE_GET_VOLUME:
|
||||
|
||||
if ((s->flags & PA_SINK_SYNC_VOLUME) && s->get_volume) {
|
||||
if ((s->flags & PA_SINK_DEFERRED_VOLUME) && s->get_volume) {
|
||||
s->get_volume(s);
|
||||
pa_sink_volume_change_flush(s);
|
||||
pa_sw_cvolume_divide(&s->thread_info.current_hw_volume, &s->real_volume, &s->soft_volume);
|
||||
|
|
@ -2497,14 +2497,14 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
pa_sink_request_rewind(s, (size_t) -1);
|
||||
}
|
||||
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME && s->set_mute)
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME && s->set_mute)
|
||||
s->set_mute(s);
|
||||
|
||||
return 0;
|
||||
|
||||
case PA_SINK_MESSAGE_GET_MUTE:
|
||||
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME && s->get_mute)
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME && s->get_mute)
|
||||
s->get_mute(s);
|
||||
|
||||
return 0;
|
||||
|
|
@ -3087,7 +3087,7 @@ int pa_sink_set_port(pa_sink *s, const char *name, pa_bool_t save) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (s->flags & PA_SINK_SYNC_VOLUME) {
|
||||
if (s->flags & PA_SINK_DEFERRED_VOLUME) {
|
||||
struct sink_message_set_port msg = { .port = port, .ret = 0 };
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_PORT, &msg, 0, NULL) == 0);
|
||||
ret = msg.ret;
|
||||
|
|
|
|||
|
|
@ -139,12 +139,12 @@ struct pa_sink {
|
|||
* (using pa_sink_set_soft_volume()) to match the current hardware
|
||||
* volume.
|
||||
*
|
||||
* If PA_SINK_SYNC_VOLUME is not set, then this is called from the
|
||||
* If PA_SINK_DEFERRED_VOLUME is not set, then this is called from the
|
||||
* main thread before sending PA_SINK_MESSAGE_GET_VOLUME, so in
|
||||
* this case the driver can choose whether to read the volume from
|
||||
* the hardware in the main thread or in the IO thread.
|
||||
*
|
||||
* If PA_SINK_SYNC_VOLUME is set, then this is called from the IO
|
||||
* If PA_SINK_DEFERRED_VOLUME is set, then this is called from the IO
|
||||
* thread within the default handler for
|
||||
* PA_SINK_MESSAGE_GET_VOLUME (the main thread is waiting while
|
||||
* the message is being processed), so there's no choice of where
|
||||
|
|
@ -159,14 +159,14 @@ struct pa_sink {
|
|||
* callback. This is called when the hardware volume needs to be
|
||||
* updated.
|
||||
*
|
||||
* If PA_SINK_SYNC_VOLUME is not set, then this is called from the
|
||||
* If PA_SINK_DEFERRED_VOLUME is not set, then this is called from the
|
||||
* main thread. The callback implementation must set the hardware
|
||||
* volume according to s->real_volume. If the driver can't set the
|
||||
* hardware volume to the exact requested value, it has to update
|
||||
* s->real_volume and/or s->soft_volume so that they together
|
||||
* match the actual hardware volume that was set.
|
||||
*
|
||||
* If PA_SINK_SYNC_VOLUME is set, then this is called from the IO
|
||||
* If PA_SINK_DEFERRED_VOLUME is set, then this is called from the IO
|
||||
* thread. The callback implementation must not actually set the
|
||||
* hardware volume yet, but it must check how close to the
|
||||
* requested volume the hardware volume can be set, and update
|
||||
|
|
@ -178,9 +178,9 @@ struct pa_sink {
|
|||
* set this callback. */
|
||||
pa_sink_cb_t set_volume; /* may be NULL */
|
||||
|
||||
/* Sink drivers that set PA_SINK_SYNC_VOLUME must provide this
|
||||
/* Sink drivers that set PA_SINK_DEFERRED_VOLUME must provide this
|
||||
* callback. This callback is not used with sinks that do not set
|
||||
* PA_SINK_SYNC_VOLUME. This is called from the IO thread when a
|
||||
* PA_SINK_DEFERRED_VOLUME. This is called from the IO thread when a
|
||||
* pending hardware volume change has to be written to the
|
||||
* hardware. The requested volume is passed to the callback
|
||||
* implementation in s->thread_info.current_hw_volume.
|
||||
|
|
@ -195,7 +195,7 @@ struct pa_sink {
|
|||
pa_sink_cb_t write_volume; /* may be NULL */
|
||||
|
||||
/* Called when the mute setting is queried. A PA_SINK_MESSAGE_GET_MUTE
|
||||
* message will also be sent. Called from IO thread if PA_SINK_SYNC_VOLUME
|
||||
* message will also be sent. Called from IO thread if PA_SINK_DEFERRED_VOLUME
|
||||
* flag is set otherwise from main loop context. If refresh_mute is FALSE
|
||||
* neither this function is called nor a message is sent.
|
||||
*
|
||||
|
|
@ -204,7 +204,7 @@ struct pa_sink {
|
|||
pa_sink_cb_t get_mute; /* may be NULL */
|
||||
|
||||
/* Called when the mute setting shall be changed. A PA_SINK_MESSAGE_SET_MUTE
|
||||
* message will also be sent. Called from IO thread if PA_SINK_SYNC_VOLUME
|
||||
* message will also be sent. Called from IO thread if PA_SINK_DEFERRED_VOLUME
|
||||
* flag is set otherwise from main loop context.
|
||||
*
|
||||
* You must use the function pa_sink_set_set_mute_callback() to
|
||||
|
|
@ -278,7 +278,7 @@ struct pa_sink {
|
|||
PA_LLIST_HEAD(pa_sink_volume_change, volume_changes);
|
||||
pa_sink_volume_change *volume_changes_tail;
|
||||
/* This value is updated in pa_sink_volume_change_apply() and
|
||||
* used only by sinks with PA_SINK_SYNC_VOLUME. */
|
||||
* used only by sinks with PA_SINK_DEFERRED_VOLUME. */
|
||||
pa_cvolume current_hw_volume;
|
||||
|
||||
/* The amount of usec volume up events are delayed and volume
|
||||
|
|
|
|||
|
|
@ -307,8 +307,8 @@ pa_source* pa_source_new(
|
|||
PA_LLIST_HEAD_INIT(pa_source_volume_change, s->thread_info.volume_changes);
|
||||
s->thread_info.volume_changes_tail = NULL;
|
||||
pa_sw_cvolume_multiply(&s->thread_info.current_hw_volume, &s->soft_volume, &s->real_volume);
|
||||
s->thread_info.volume_change_safety_margin = core->sync_volume_safety_margin_usec;
|
||||
s->thread_info.volume_change_extra_delay = core->sync_volume_extra_delay_usec;
|
||||
s->thread_info.volume_change_safety_margin = core->deferred_volume_safety_margin_usec;
|
||||
s->thread_info.volume_change_extra_delay = core->deferred_volume_extra_delay_usec;
|
||||
|
||||
/* FIXME: This should probably be moved to pa_source_put() */
|
||||
pa_assert_se(pa_idxset_put(core->sources, s, &s->index) >= 0);
|
||||
|
|
@ -426,9 +426,9 @@ void pa_source_set_write_volume_callback(pa_source *s, pa_source_cb_t cb) {
|
|||
flags = s->flags;
|
||||
|
||||
if (cb)
|
||||
s->flags |= PA_SOURCE_SYNC_VOLUME;
|
||||
s->flags |= PA_SOURCE_DEFERRED_VOLUME;
|
||||
else
|
||||
s->flags &= ~PA_SOURCE_SYNC_VOLUME;
|
||||
s->flags &= ~PA_SOURCE_DEFERRED_VOLUME;
|
||||
|
||||
/* If the flags have changed after init, let any clients know via a change event */
|
||||
if (s->state != PA_SOURCE_INIT && flags != s->flags)
|
||||
|
|
@ -526,7 +526,7 @@ void pa_source_put(pa_source *s) {
|
|||
* Note: All of these flags set here can change over the life time
|
||||
* of the source. */
|
||||
pa_assert(!(s->flags & PA_SOURCE_HW_VOLUME_CTRL) || s->set_volume);
|
||||
pa_assert(!(s->flags & PA_SOURCE_SYNC_VOLUME) || s->write_volume);
|
||||
pa_assert(!(s->flags & PA_SOURCE_DEFERRED_VOLUME) || s->write_volume);
|
||||
pa_assert(!(s->flags & PA_SOURCE_HW_MUTE_CTRL) || s->set_mute);
|
||||
|
||||
/* XXX: Currently decibel volume is disabled for all sources that use volume
|
||||
|
|
@ -1452,7 +1452,7 @@ void pa_source_set_volume(
|
|||
* apply one to root_source->soft_volume */
|
||||
|
||||
pa_cvolume_reset(&root_source->soft_volume, root_source->sample_spec.channels);
|
||||
if (!(root_source->flags & PA_SOURCE_SYNC_VOLUME))
|
||||
if (!(root_source->flags & PA_SOURCE_DEFERRED_VOLUME))
|
||||
root_source->set_volume(root_source);
|
||||
|
||||
} else
|
||||
|
|
@ -1472,7 +1472,7 @@ void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert(!(s->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER));
|
||||
|
||||
if (s->flags & PA_SOURCE_SYNC_VOLUME)
|
||||
if (s->flags & PA_SOURCE_DEFERRED_VOLUME)
|
||||
pa_source_assert_io_context(s);
|
||||
else
|
||||
pa_assert_ctl_context();
|
||||
|
|
@ -1482,7 +1482,7 @@ void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume) {
|
|||
else
|
||||
s->soft_volume = *volume;
|
||||
|
||||
if (PA_SOURCE_IS_LINKED(s->state) && !(s->flags & PA_SOURCE_SYNC_VOLUME))
|
||||
if (PA_SOURCE_IS_LINKED(s->state) && !(s->flags & PA_SOURCE_DEFERRED_VOLUME))
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_VOLUME, NULL, 0, NULL) == 0);
|
||||
else
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
|
|
@ -1575,7 +1575,7 @@ const pa_cvolume *pa_source_get_volume(pa_source *s, pa_bool_t force_refresh) {
|
|||
|
||||
old_real_volume = s->real_volume;
|
||||
|
||||
if (!(s->flags & PA_SOURCE_SYNC_VOLUME) && s->get_volume)
|
||||
if (!(s->flags & PA_SOURCE_DEFERRED_VOLUME) && s->get_volume)
|
||||
s->get_volume(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_VOLUME, NULL, 0, NULL) == 0);
|
||||
|
|
@ -1616,7 +1616,7 @@ void pa_source_set_mute(pa_source *s, pa_bool_t mute, pa_bool_t save) {
|
|||
s->muted = mute;
|
||||
s->save_muted = (old_muted == s->muted && s->save_muted) || save;
|
||||
|
||||
if (!(s->flags & PA_SOURCE_SYNC_VOLUME) && s->set_mute)
|
||||
if (!(s->flags & PA_SOURCE_DEFERRED_VOLUME) && s->set_mute)
|
||||
s->set_mute(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
|
||||
|
|
@ -1635,7 +1635,7 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
|
|||
if (s->refresh_muted || force_refresh) {
|
||||
pa_bool_t old_muted = s->muted;
|
||||
|
||||
if (!(s->flags & PA_SOURCE_SYNC_VOLUME) && s->get_mute)
|
||||
if (!(s->flags & PA_SOURCE_DEFERRED_VOLUME) && s->get_mute)
|
||||
s->get_mute(s);
|
||||
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
|
||||
|
|
@ -1885,7 +1885,7 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
|
|||
|
||||
case PA_SOURCE_MESSAGE_SET_VOLUME_SYNCED:
|
||||
|
||||
if (s->flags & PA_SOURCE_SYNC_VOLUME) {
|
||||
if (s->flags & PA_SOURCE_DEFERRED_VOLUME) {
|
||||
s->set_volume(s);
|
||||
pa_source_volume_change_push(s);
|
||||
}
|
||||
|
|
@ -1905,7 +1905,7 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
|
|||
|
||||
case PA_SOURCE_MESSAGE_GET_VOLUME:
|
||||
|
||||
if ((s->flags & PA_SOURCE_SYNC_VOLUME) && s->get_volume) {
|
||||
if ((s->flags & PA_SOURCE_DEFERRED_VOLUME) && s->get_volume) {
|
||||
s->get_volume(s);
|
||||
pa_source_volume_change_flush(s);
|
||||
pa_sw_cvolume_divide(&s->thread_info.current_hw_volume, &s->real_volume, &s->soft_volume);
|
||||
|
|
@ -1924,14 +1924,14 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
|
|||
s->thread_info.soft_muted = s->muted;
|
||||
}
|
||||
|
||||
if (s->flags & PA_SOURCE_SYNC_VOLUME && s->set_mute)
|
||||
if (s->flags & PA_SOURCE_DEFERRED_VOLUME && s->set_mute)
|
||||
s->set_mute(s);
|
||||
|
||||
return 0;
|
||||
|
||||
case PA_SOURCE_MESSAGE_GET_MUTE:
|
||||
|
||||
if (s->flags & PA_SOURCE_SYNC_VOLUME && s->get_mute)
|
||||
if (s->flags & PA_SOURCE_DEFERRED_VOLUME && s->get_mute)
|
||||
s->get_mute(s);
|
||||
|
||||
return 0;
|
||||
|
|
@ -2423,7 +2423,7 @@ int pa_source_set_port(pa_source *s, const char *name, pa_bool_t save) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (s->flags & PA_SOURCE_SYNC_VOLUME) {
|
||||
if (s->flags & PA_SOURCE_DEFERRED_VOLUME) {
|
||||
struct source_message_set_port msg = { .port = port, .ret = 0 };
|
||||
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_PORT, &msg, 0, NULL) == 0);
|
||||
ret = msg.ret;
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ struct pa_source {
|
|||
* set this callback. */
|
||||
pa_source_cb_t set_volume; /* may be NULL */
|
||||
|
||||
/* Source drivers that set PA_SOURCE_SYNC_VOLUME must provide this
|
||||
/* Source drivers that set PA_SOURCE_DEFERRED_VOLUME must provide this
|
||||
* callback. This callback is not used with source that do not set
|
||||
* PA_SOURCE_SYNC_VOLUME. This is called from the IO thread when a
|
||||
* PA_SOURCE_DEFERRED_VOLUME. This is called from the IO thread when a
|
||||
* pending hardware volume change has to be written to the
|
||||
* hardware. The requested volume is passed to the callback
|
||||
* implementation in s->thread_info.current_hw_volume.
|
||||
|
|
@ -207,7 +207,7 @@ struct pa_source {
|
|||
PA_LLIST_HEAD(pa_source_volume_change, volume_changes);
|
||||
pa_source_volume_change *volume_changes_tail;
|
||||
/* This value is updated in pa_source_volume_change_apply() and
|
||||
* used only by sources with PA_SOURCE_SYNC_VOLUME. */
|
||||
* used only by sources with PA_SOURCE_DEFERRED_VOLUME. */
|
||||
pa_cvolume current_hw_volume;
|
||||
|
||||
/* The amount of usec volume up events are delayed and volume
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue