[PATCH 1/4] sink, source: Assign to reference_volume from only one place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



07.04.2014 18:24, Tanu Kaskinen wrote:
>   
> +/* Called from the main thread. */
> +static void set_reference_volume_internal(pa_sink *s, const pa_cvolume *volume) {
> +    pa_cvolume old_volume;
> +    char old_volume_str[PA_CVOLUME_SNPRINT_VERBOSE_MAX];
> +    char new_volume_str[PA_CVOLUME_SNPRINT_VERBOSE_MAX];
> +
> +    pa_assert(s);
> +    pa_assert(volume);

Note the assertions.

> +
> +/* Called from the main thread. */
> +void pa_sink_set_reference_volume_direct(pa_sink *s, const pa_cvolume *volume) {
> +    pa_assert(s);
> +    pa_assert(volume);
> +
> +    set_reference_volume_internal(s, volume);
> +}

What's the point of having this function in this patch? As demonstrated 
above, set_reference_volume_internal does the same assertions.

Same for sources.

The patch does look like an equivalent refactoring.

-- 
Alexander E. Patrakov



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux