From 5a195845e3a5b37f1081546e275858bedb85f755 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 11 Jul 2013 23:53:21 +0200 Subject: ao_coreaudio: store asbd only when selected Previous code needlessly stored the input asbd before actually testing it's support against the hardware. --- audio/out/ao_coreaudio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'audio') 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 || -- cgit v1.2.3