From de740b2520fc49a7505ef2fb8b1aca89b452db1a Mon Sep 17 00:00:00 2001 From: Amitesh Singh Date: Wed, 14 Oct 2015 21:51:00 +0530 Subject: [PATCH] pulseaudio: pass big data as pass by reference CID: 1308394 --- src/modules/mixer/lib/backends/pulseaudio/pulse.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c b/src/modules/mixer/lib/backends/pulseaudio/pulse.c index a00ffb0..9122735 100644 --- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c +++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c @@ -64,12 +64,12 @@ _emix_volume_convert(const Emix_Volume volume) } static Emix_Volume -_pa_cvolume_convert(const pa_cvolume volume) +_pa_cvolume_convert(const pa_cvolume *volume) { Emix_Volume vol; int i; - vol.volumes = calloc(volume.channels, sizeof(int)); + vol.volumes = calloc(volume->channels, sizeof(int)); if (!vol.volumes) { WRN("Could not allocate memory for volume"); @@ -77,9 +77,9 @@ _pa_cvolume_convert(const pa_cvolume volume) return vol; } - vol.channel_count = volume.channels; - for (i = 0; i < volume.channels; i++) - vol.volumes[i] = PA_VOLUME_TO_INT(volume.values[i]); + vol.channel_count = volume->channels; + for (i = 0; i < volume->channels; i++) + vol.volumes[i] = PA_VOLUME_TO_INT(volume->values[i]); return vol; } @@ -148,7 +148,7 @@ _sink_cb(pa_context *c EINA_UNUSED, const pa_sink_info *info, int eol, sink = calloc(1, sizeof(Sink)); sink->idx = info->index; sink->base.name = eina_stringshare_add(info->description); - sink->base.volume = _pa_cvolume_convert(info->volume); + sink->base.volume = _pa_cvolume_convert(&info->volume); sink->base.mute = !!info->mute; for (i = 0; i < info->n_ports; i++) @@ -210,7 +210,7 @@ _sink_changed_cb(pa_context *c EINA_UNUSED, const pa_sink_info *info, int eol, EINA_SAFETY_ON_NULL_RETURN(sink); sink->base.name = eina_stringshare_add(info->description); - sink->base.volume = _pa_cvolume_convert(info->volume); + sink->base.volume = _pa_cvolume_convert(&info->volume); sink->base.mute = !!info->mute; if (sink->base.ports) @@ -328,7 +328,7 @@ _sink_input_cb(pa_context *c EINA_UNUSED, const pa_sink_input_info *info, input->idx = info->index; input->base.name = eina_stringshare_add(info->name); - input->base.volume = _pa_cvolume_convert(info->volume); + input->base.volume = _pa_cvolume_convert(&info->volume); input->base.mute = !!info->mute; EINA_LIST_FOREACH(ctx->sinks, l, s) { @@ -382,7 +382,7 @@ _sink_input_changed_cb(pa_context *c EINA_UNUSED, ctx->inputs = eina_list_append(ctx->inputs, input); } input->idx = info->index; - input->base.volume = _pa_cvolume_convert(info->volume); + input->base.volume = _pa_cvolume_convert(&info->volume); input->base.mute = !!info->mute; if (ctx->cb) @@ -439,7 +439,7 @@ _source_cb(pa_context *c EINA_UNUSED, const pa_source_info *info, source->idx = info->index; source->base.name = eina_stringshare_add(info->name); - source->base.volume = _pa_cvolume_convert(info->volume); + source->base.volume = _pa_cvolume_convert(&info->volume); source->base.mute = !!info->mute; ctx->sources = eina_list_append(ctx->sources, source); @@ -487,7 +487,7 @@ _source_changed_cb(pa_context *c EINA_UNUSED, ctx->sources = eina_list_append(ctx->sources, source); } source->idx= info->index; - source->base.volume = _pa_cvolume_convert(info->volume); + source->base.volume = _pa_cvolume_convert(&info->volume); source->base.mute = !!info->mute; if (ctx->cb) -- 2.7.4