Bug 54252 - [cleanup] sync_input_volumes_within_thread() has unnecessary code duplication
Summary: [cleanup] sync_input_volumes_within_thread() has unnecessary code duplication
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 08:41 UTC by Tanu Kaskinen
Modified: 2018-07-30 09:34 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Tanu Kaskinen 2012-08-30 08:41:04 UTC
This is sync_input_volumes_within_thread():

static void sync_input_volumes_within_thread(pa_sink *s) {
    pa_sink_input *i;
    void *state = NULL;

    pa_sink_assert_ref(s);
    pa_sink_assert_io_context(s);

    PA_HASHMAP_FOREACH(i, s->thread_info.inputs, state) {
        if (pa_cvolume_equal(&i->thread_info.soft_volume, &i->soft_volume))
            continue;

        i->thread_info.soft_volume = i->soft_volume;
        pa_sink_input_request_rewind(i, 0, TRUE, FALSE, FALSE);
    }
}


And this is the PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME handler:

case PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME:
    if (!pa_cvolume_equal(&i->thread_info.soft_volume, &i->soft_volume)) {
        i->thread_info.soft_volume = i->soft_volume;
        pa_sink_input_request_rewind(i, 0, TRUE, FALSE, FALSE);
    }
    return 0;


Instead of duplicating the code in the SET_SOFT_VOLUME handler, sync_input_volumes_within_thread() should call i->process_msg(PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME).
Comment 1 GitLab Migration User 2018-07-30 09:34:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/18.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.