From e2f26f01fed17a156653994702a270e01732eb65 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 3 May 2014 13:18:37 +0200 Subject: ao_coreaudio: pass layout by reference to logging function Apparently passing the struct by value somehow messed with the value of some fields. --- audio/out/ao_coreaudio_utils.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index a8f661819d..8c3b0dca1d 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -431,20 +431,20 @@ static bool ca_bitmap_from_ch_tag(struct ao *ao, AudioChannelLayout *layout, } } -static void ca_log_layout(struct ao *ao, AudioChannelLayout layout) +static void ca_log_layout(struct ao *ao, AudioChannelLayout *layout) { if (!mp_msg_test(ao->log, MSGL_V)) return; - AudioChannelDescription *descs = layout.mChannelDescriptions; + AudioChannelDescription *descs = layout->mChannelDescriptions; MP_VERBOSE(ao, "layout: tag: <%d>, bitmap: <%d>, " "descriptions <%d>\n", - layout.mChannelLayoutTag, - layout.mChannelBitmap, - layout.mNumberChannelDescriptions); + layout->mChannelLayoutTag, + layout->mChannelBitmap, + layout->mNumberChannelDescriptions); - for (int i = 0; i < layout.mNumberChannelDescriptions; i++) { + for (int i = 0; i < layout->mNumberChannelDescriptions; i++) { AudioChannelDescription d = descs[i]; MP_VERBOSE(ao, " - description %d: label <%d, %d>, flags: <%u>, " "coords: <%f, %f, %f>\n", i, @@ -466,7 +466,7 @@ void ca_bitmaps_from_layouts(struct ao *ao, for (int i=0; i < n_layouts; i++) { uint32_t bitmap = 0; - ca_log_layout(ao, layouts[i]); + ca_log_layout(ao, &layouts[i]); switch (layouts[i].mChannelLayoutTag) { case kAudioChannelLayoutTag_UseChannelBitmap: -- cgit v1.2.3