diff options
author | wm4 <wm4@nowhere> | 2015-04-29 23:08:16 +0200 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-05-07 10:41:26 +0900 |
commit | 63402eb1dd761328931411b474480298cf47c2b3 (patch) | |
tree | a65f5bb30c2cbf0f7827378b96f7777ba94d265b /audio | |
parent | 8bcd9ea67169a2ba9afd016648f47631717addff (diff) | |
download | mpv-63402eb1dd761328931411b474480298cf47c2b3.tar.bz2 mpv-63402eb1dd761328931411b474480298cf47c2b3.tar.xz |
ao_coreaudio_exclusive: check format explicitly on change notifcation
This should for now be equivalent; it's merely more explicit and will
be required if we add PCM support.
Note that the property listeners actually tell you what property
exactly changed, but resolving the current listener mess would be too
hard. So check for changes manually.
(cherry picked from commit 382434d45a72967f5b607c871e363e02dce1f1e6)
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio_exclusive.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c index 6f5f247459..3e397486a2 100644 --- a/audio/out/ao_coreaudio_exclusive.c +++ b/audio/out/ao_coreaudio_exclusive.c @@ -357,12 +357,17 @@ static OSStatus render_cb_digital( // Check whether we need to reset the digital output stream. if (p->stream_asbd_changed) { - p->stream_asbd_changed = 0; - if (!p->reload_requested && ca_stream_supports_digital(ao, p->stream)) { - p->reload_requested = true; - ao_request_reload(ao); - MP_INFO(ao, "Stream format changed! Reloading.\n"); - } + AudioStreamBasicDescription f; + OSErr err = CA_GET(p->stream, kAudioStreamPropertyPhysicalFormat, &f); + CHECK_CA_WARN("could not get stream format"); + if (err == noErr && ca_asbd_equals(&p->stream_asbd, &f)) + p->stream_asbd_changed = 0; + } + + if (p->stream_asbd_changed && !p->reload_requested) { + p->reload_requested = true; + ao_request_reload(ao); + MP_INFO(ao, "Stream format changed! Reloading.\n"); } return noErr; |