diff options
author | wm4 <wm4@nowhere> | 2015-10-21 18:54:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-21 18:54:36 +0200 |
commit | 78112c858246f9018140d87d8cfc32868ff56fbb (patch) | |
tree | 96b99dbf20dccc75843e26b271670dfabe853967 /audio/out | |
parent | ff778f6d684a632f9c91fd8488aa5e1ef2fc8ad0 (diff) |
ao_coreaudio: avoid unnecessary format changes
Not particularly important; just being nice and potentially avoiding
problems caused by format setting.
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_coreaudio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 90aa672de6..facbc601f6 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -237,6 +237,12 @@ static void init_physical_format(struct ao *ao) &p->original_asbd); CHECK_CA_WARN("could not get current physical stream format"); + if (ca_asbd_equals(&p->original_asbd, &best_asbd)) { + MP_VERBOSE(ao, "Requested format already set, not changing.\n"); + p->original_asbd.mFormatID = 0; + break; + } + if (!ca_change_physical_format_sync(ao, streams[i], best_asbd)) p->original_asbd = (AudioStreamBasicDescription){0}; break; |