ao_coreaudio: pass layout by reference to logging function

Apparently passing the struct by value somehow messed with the value of some
fields.
This commit is contained in:
Stefano Pigozzi 2014-05-03 13:18:37 +02:00
parent e7d1c12131
commit e2f26f01fe
1 changed files with 7 additions and 7 deletions

View File

@ -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: