[pulseaudio-tickets] [Bug 54252] New: [cleanup] sync_input_volumes_within_thread() has unnecessary code duplication

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 30 01:41:04 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=54252

             Bug #: 54252
           Summary: [cleanup] sync_input_volumes_within_thread() has
                    unnecessary code duplication
    Classification: Unclassified
           Product: PulseAudio
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: medium
         Component: core
        AssignedTo: pulseaudio-bugs at lists.freedesktop.org
        ReportedBy: tanuk at iki.fi
         QAContact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net


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).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the pulseaudio-bugs mailing list