summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-28 22:11:43 +0200
committerwm4 <wm4@nowhere>2015-04-28 22:11:43 +0200
commit8b4ca5806207c1482df30d9815e6970697cea5b2 (patch)
tree3f6c02dfa988d6b63640533b19f3f6881f964389 /audio/out
parentd5e9bf66a1e0c4578bd8bef5c9f725dbc47e9fc6 (diff)
downloadmpv-8b4ca5806207c1482df30d9815e6970697cea5b2.tar.bz2
mpv-8b4ca5806207c1482df30d9815e6970697cea5b2.tar.xz
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.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_coreaudio_exclusive.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c
index 762decffa4..6f5f247459 100644
--- a/audio/out/ao_coreaudio_exclusive.c
+++ b/audio/out/ao_coreaudio_exclusive.c
@@ -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;