ao_coreaudio_exclusive: move code for getting original format
Should be almost equivalent, unless there are streams on which this call
does not work for unknown reasons.
(cherry picked from commit 8b4ca58062)
This commit is contained in:
1 parent
87713640ae
commit
477eefa63f
1 file changed
+4
-6
@@ -433,12 +433,6 @@ static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd)
|
||||
bool digital = ca_stream_supports_digital(ao, streams[i]);
|
||||
|
||||
if (digital) {
|
||||
err = CA_GET(streams[i], kAudioStreamPropertyPhysicalFormat,
|
||||
&p->original_asbd);
|
||||
if (!CHECK_CA_WARN("could not get stream's physical format to "
|
||||
"revert to, getting the next one"))
|
||||
continue;
|
||||
|
||||
AudioStreamRangedDescription *formats;
|
||||
size_t n_formats;
|
||||
|
||||
@@ -485,6 +479,10 @@ static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd)
|
||||
goto coreaudio_error;
|
||||
}
|
||||
|
||||
err = CA_GET(p->stream, kAudioStreamPropertyPhysicalFormat,
|
||||
&p->original_asbd);
|
||||
CHECK_CA_ERROR("could not get stream's original physical format");
|
||||
|
||||
if (!ca_change_format(ao, p->stream, p->stream_asbd))
|
||||
goto coreaudio_error;
|
||||
|
||||
|
||||
Reference in new issue
Block a user