summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-sink.c
diff options
context:
space:
mode:
authorJyri Sarha <jyri.sarha@nokia.com>2011-01-13 16:44:44 +0200
committerColin Guthrie <cguthrie@mandriva.org>2011-01-15 13:26:07 +0000
commit98db3dffb6250f814a79498e7752f86434d89b74 (patch)
treea93dd7be764718aa8c9f90989749b1209911706a /src/modules/alsa/alsa-sink.c
parent3d83a0cf520b92b39d5c74a1cdbc845dd6c923c9 (diff)
alsa-sink: Fix double use of string
Diffstat (limited to 'src/modules/alsa/alsa-sink.c')
-rw-r--r--src/modules/alsa/alsa-sink.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 53c14b80..a8ba3632 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1281,15 +1281,17 @@ static void sink_write_volume_cb(pa_sink *s) {
(pa_cvolume_max(&tmp_vol) <= (PA_VOLUME_NORM + VOLUME_ACCURACY));
if (!accurate_enough) {
- char vol_str_pcnt[PA_CVOLUME_SNPRINT_MAX];
- char vol_str_db[PA_SW_CVOLUME_SNPRINT_DB_MAX];
+ union {
+ char db[2][PA_SW_CVOLUME_SNPRINT_DB_MAX];
+ char pcnt[2][PA_CVOLUME_SNPRINT_MAX];
+ } vol;
pa_log_debug("Written HW volume did not match with the request: %s (request) != %s",
- pa_cvolume_snprint(vol_str_pcnt, sizeof(vol_str_pcnt), &s->thread_info.current_hw_volume),
- pa_cvolume_snprint(vol_str_pcnt, sizeof(vol_str_pcnt), &hw_vol));
+ pa_cvolume_snprint(vol.pcnt[0], sizeof(vol.pcnt[0]), &s->thread_info.current_hw_volume),
+ pa_cvolume_snprint(vol.pcnt[1], sizeof(vol.pcnt[1]), &hw_vol));
pa_log_debug(" in dB: %s (request) != %s",
- pa_sw_cvolume_snprint_dB(vol_str_db, sizeof(vol_str_db), &s->thread_info.current_hw_volume),
- pa_sw_cvolume_snprint_dB(vol_str_db, sizeof(vol_str_db), &hw_vol));
+ pa_sw_cvolume_snprint_dB(vol.db[0], sizeof(vol.db[0]), &s->thread_info.current_hw_volume),
+ pa_sw_cvolume_snprint_dB(vol.db[1], sizeof(vol.db[1]), &hw_vol));
}
}
}