ao_coreaudio: avoid unnecessary format changes

Not particularly important; just being nice and potentially avoiding
problems caused by format setting.
This commit is contained in:
wm4
2015-10-21 18:54:36 +02:00
parent ff778f6d68
commit 78112c8582
+6
View File
@@ -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;