summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-11 23:53:21 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-22 21:53:18 +0200
commit5a195845e3a5b37f1081546e275858bedb85f755 (patch)
treec8c7d6575d1f7a571706b8d94d26e81b9caf4222
parent4e0618dab94f881a162a2aac8d88092183d43f28 (diff)
downloadmpv-5a195845e3a5b37f1081546e275858bedb85f755.tar.bz2
mpv-5a195845e3a5b37f1081546e275858bedb85f755.tar.xz
ao_coreaudio: store asbd only when selected
Previous code needlessly stored the input asbd before actually testing it's support against the hardware.
-rw-r--r--audio/out/ao_coreaudio.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index df59683add..1a1c64ba47 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -560,8 +560,6 @@ static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd)
if (!is_alive)
ca_msg(MSGL_WARN, "device is not alive\n");
- d->stream_asbd = asbd;
-
p->is_digital = 1;
err = ca_lock_device(p->device, &d->hog_pid);
@@ -612,8 +610,7 @@ static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd)
// select the digital format that has exactly the same
// samplerate. If an exact match cannot be found, select
// the format with highest samplerate as backup.
- if (formats[j].mFormat.mSampleRate ==
- d->stream_asbd.mSampleRate) {
+ if (formats[j].mFormat.mSampleRate == asbd.mSampleRate) {
req_rate_format = j;
break;
} else if (max_rate_format < 0 ||