summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_chmap.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-26 15:51:50 +0100
committerwm4 <wm4@nowhere>2015-10-26 15:51:50 +0100
commit81109dcbb6093f7c4298a1c677a2d06cea5107d8 (patch)
tree4227ee6c09445ca233289f767257a2ad3d0fc0d8 /audio/out/ao_coreaudio_chmap.c
parentfa510bd00cc62646255123504b3bfd4fc491f6bc (diff)
downloadmpv-81109dcbb6093f7c4298a1c677a2d06cea5107d8.tar.bz2
mpv-81109dcbb6093f7c4298a1c677a2d06cea5107d8.tar.xz
ao_coreaudio_chmap: add more logging
Diffstat (limited to 'audio/out/ao_coreaudio_chmap.c')
-rw-r--r--audio/out/ao_coreaudio_chmap.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/audio/out/ao_coreaudio_chmap.c b/audio/out/ao_coreaudio_chmap.c
index a034a01668..52ea81d5c7 100644
--- a/audio/out/ao_coreaudio_chmap.c
+++ b/audio/out/ao_coreaudio_chmap.c
@@ -98,6 +98,9 @@ static AudioChannelLayout *ca_layout_to_custom_layout(struct ao *ao,
AudioChannelLayout *r;
OSStatus err;
+ if (tag == kAudioChannelLayoutTag_UseChannelDescriptions)
+ return l;
+
if (tag == kAudioChannelLayoutTag_UseChannelBitmap) {
uint32_t psize;
err = AudioFormatGetPropertyInfo(
@@ -109,7 +112,7 @@ static AudioChannelLayout *ca_layout_to_custom_layout(struct ao *ao,
kAudioFormatProperty_ChannelLayoutForBitmap,
sizeof(uint32_t), &l->mChannelBitmap, &psize, r);
CHECK_CA_ERROR("failed to convert channel bitmap to descriptions (get)");
- } else if (tag != kAudioChannelLayoutTag_UseChannelDescriptions) {
+ } else {
uint32_t psize;
err = AudioFormatGetPropertyInfo(
kAudioFormatProperty_ChannelLayoutForTag,
@@ -120,10 +123,11 @@ static AudioChannelLayout *ca_layout_to_custom_layout(struct ao *ao,
kAudioFormatProperty_ChannelLayoutForTag,
sizeof(AudioChannelLayoutTag), &l->mChannelLayoutTag, &psize, r);
CHECK_CA_ERROR("failed to convert channel tag to descriptions (get)");
- } else {
- r = l;
}
+ MP_VERBOSE(ao, "converted input channel layout:\n");
+ ca_log_layout(ao, MSGL_V, l);
+
return r;
coreaudio_error:
return NULL;
@@ -134,16 +138,13 @@ static bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout,
{
void *talloc_ctx = talloc_new(NULL);
- MP_DBG(ao, "input channel layout:\n");
- ca_log_layout(ao, MSGL_DEBUG, layout);
+ MP_VERBOSE(ao, "input channel layout:\n");
+ ca_log_layout(ao, MSGL_V, layout);
AudioChannelLayout *l = ca_layout_to_custom_layout(ao, talloc_ctx, layout);
if (!l)
goto coreaudio_error;
- MP_VERBOSE(ao, "converted input channel layout:\n");
- ca_log_layout(ao, MSGL_V, l);
-
if (l->mNumberChannelDescriptions > MP_NUM_CHANNELS) {
MP_VERBOSE(ao, "layout has too many descriptions (%u, max: %d)\n",
(unsigned) l->mNumberChannelDescriptions, MP_NUM_CHANNELS);
@@ -164,6 +165,7 @@ static bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout,
}
talloc_free(talloc_ctx);
+ MP_VERBOSE(ao, "mp chmap: %s\n", mp_chmap_to_str(chmap));
return mp_chmap_is_valid(chmap) && !mp_chmap_is_unknown(chmap);
coreaudio_error:
MP_VERBOSE(ao, "converted input channel layout (failed):\n");