i->process_rewind(i, amount);
called = true;
- /* Convert back to to sink domain */
+ /* Convert back to sink domain */
if (i->thread_info.resampler)
amount = pa_resampler_result(i->thread_info.resampler, amount);
pa_assert_ctl_context();
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
- v = pa_hashmap_remove(i->volume_factor_items, key);
-
- if (!v)
+ if (pa_hashmap_remove_and_free(i->volume_factor_items, key) < 0)
return -1;
- volume_factor_entry_free(v);
-
switch (pa_hashmap_size(i->volume_factor_items)) {
case 0:
pa_cvolume_reset(&i->volume_factor, i->sample_spec.channels);
pa_assert_ctl_context();
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
- if (!i->muted == !mute) {
- i->save_muted = i->save_muted || mute;
+ if (mute == i->muted) {
+ i->save_muted |= save;
return;
}
* their volume - this function does all that by using recursion. */
static void update_volume_due_to_moving(pa_sink_input *i, pa_sink *dest) {
pa_cvolume old_volume;
+ pa_cvolume new_volume;
pa_assert(i);
pa_assert(dest);
* (sinks that use volume sharing should always have
* soft_volume of 0 dB) */
- old_volume = i->origin_sink->reference_volume;
-
- i->origin_sink->reference_volume = root_sink->reference_volume;
- pa_cvolume_remap(&i->origin_sink->reference_volume, &root_sink->channel_map, &i->origin_sink->channel_map);
+ new_volume = root_sink->reference_volume;
+ pa_cvolume_remap(&new_volume, &root_sink->channel_map, &i->origin_sink->channel_map);
+ pa_sink_set_reference_volume_direct(i->origin_sink, &new_volume);
i->origin_sink->real_volume = root_sink->real_volume;
pa_cvolume_remap(&i->origin_sink->real_volume, &root_sink->channel_map, &i->origin_sink->channel_map);
pa_assert(pa_cvolume_is_norm(&i->origin_sink->soft_volume));
- /* Notify others about the changed sink volume. If you wonder whether
- * i->origin_sink->set_volume() should be called somewhere, that's not
- * the case, because sinks that use volume sharing shouldn't have any
- * internal volume that set_volume() would update. If you wonder
- * whether the thread_info variables should be synced, yes, they
- * should, and it's done by the PA_SINK_MESSAGE_FINISH_MOVE message
- * handler. */
- if (!pa_cvolume_equal(&i->origin_sink->reference_volume, &old_volume))
- pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, i->origin_sink->index);
+ /* If you wonder whether i->origin_sink->set_volume() should be called
+ * somewhere, that's not the case, because sinks that use volume
+ * sharing shouldn't have any internal volume that set_volume() would
+ * update. If you wonder whether the thread_info variables should be
+ * synced, yes, they should, and it's done by the
+ * PA_SINK_MESSAGE_FINISH_MOVE message handler. */
/* Recursively update origin sink inputs. */
PA_IDXSET_FOREACH(origin_sink_input, i->origin_sink->inputs, idx)
i->requested_resample_method,
((i->flags & PA_SINK_INPUT_VARIABLE_RATE) ? PA_RESAMPLER_VARIABLE_RATE : 0) |
((i->flags & PA_SINK_INPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
- (i->core->disable_remixing || (i->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0));
+ (i->core->disable_remixing || (i->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
+ (i->core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0));
if (!new_resampler) {
pa_log_warn("Unsupported resampling operation.");