mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 08:12:17 +00:00
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.
This commit is contained in:
parent
34a5229b23
commit
382434d45a
@ -357,13 +357,18 @@ static OSStatus render_cb_digital(
|
|||||||
|
|
||||||
// Check whether we need to reset the digital output stream.
|
// Check whether we need to reset the digital output stream.
|
||||||
if (p->stream_asbd_changed) {
|
if (p->stream_asbd_changed) {
|
||||||
|
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;
|
p->stream_asbd_changed = 0;
|
||||||
if (!p->reload_requested && ca_stream_supports_digital(ao, p->stream)) {
|
}
|
||||||
|
|
||||||
|
if (p->stream_asbd_changed && !p->reload_requested) {
|
||||||
p->reload_requested = true;
|
p->reload_requested = true;
|
||||||
ao_request_reload(ao);
|
ao_request_reload(ao);
|
||||||
MP_INFO(ao, "Stream format changed! Reloading.\n");
|
MP_INFO(ao, "Stream format changed! Reloading.\n");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user