summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-28 22:11:43 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-29 18:40:37 +0900
commit477eefa63fb4f0858a858c4dd68f5f0ae1dfee34 (patch)
tree8a28e9f60c8a0954601ebccc9521a6cd931bda6c
parent87713640aee2b4942894721f82dd972c46e4eb8d (diff)
downloadmpv-477eefa63fb4f0858a858c4dd68f5f0ae1dfee34.tar.bz2
mpv-477eefa63fb4f0858a858c4dd68f5f0ae1dfee34.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. (cherry picked from commit 8b4ca5806207c1482df30d9815e6970697cea5b2)
-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;