diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-04-24 09:52:38 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-30 11:45:31 +0200 |
commit | 9f46be73731b7f95e9a0e3bf7fee43eeae82de99 (patch) | |
tree | 571cd162df175e3aefe468cd475bb087a51c2b98 | |
parent | 3623fb38eea272da140b9d9c7a9aa734ce468daf (diff) | |
download | mpv-9f46be73731b7f95e9a0e3bf7fee43eeae82de99.tar.bz2 mpv-9f46be73731b7f95e9a0e3bf7fee43eeae82de99.tar.xz |
ao_coreaudio: log even more info in verbose mode
This logs more info that can be used for debugging purposes, in particular
it prints all the AudioChannelDescription in the descriptions array.
-rw-r--r-- | audio/out/ao_coreaudio_utils.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index 9971c2d5ff..a8f661819d 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -431,6 +431,32 @@ static bool ca_bitmap_from_ch_tag(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; + + MP_VERBOSE(ao, "layout: tag: <%d>, bitmap: <%d>, " + "descriptions <%d>\n", + layout.mChannelLayoutTag, + layout.mChannelBitmap, + layout.mNumberChannelDescriptions); + + 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, + d.mChannelLabel, + ca_label_to_mp_speaker_id(d.mChannelLabel), + d.mChannelFlags, + d.mCoordinates[0], + d.mCoordinates[1], + d.mCoordinates[2]); + } +} + void ca_bitmaps_from_layouts(struct ao *ao, AudioChannelLayout *layouts, size_t n_layouts, uint32_t **bitmaps, size_t *n_bitmaps) @@ -440,11 +466,7 @@ void ca_bitmaps_from_layouts(struct ao *ao, for (int i=0; i < n_layouts; i++) { uint32_t bitmap = 0; - MP_VERBOSE(ao, "device layout %i: tag: <%d>, bitmap: <%d>, " - "descriptions number <%d>\n", i, - layouts[i].mChannelLayoutTag, - layouts[i].mChannelBitmap, - layouts[i].mNumberChannelDescriptions); + ca_log_layout(ao, layouts[i]); switch (layouts[i].mChannelLayoutTag) { case kAudioChannelLayoutTag_UseChannelBitmap: |