From c42bb4a7e8b22820c1827bd201f8aef284ecd214 Mon Sep 17 00:00:00 2001
From: Stan Seibert <volsung@xiph.org>
Date: Wed, 10 Sep 2003 14:21:15 +0000
Subject: [PATCH] Clearly mark the pcm handle as uninitialized so we don't try
 and close it later.  Closes bug 450.

git-svn-id: http://svn.xiph.org/trunk/ao@5326 0101bb08-14d6-0310-b084-bc0e0c8e3800
---
 src/plugins/alsa09/ao_alsa09.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/alsa09/ao_alsa09.c b/src/plugins/alsa09/ao_alsa09.c
index a2668e6..16eb068 100644
--- a/src/plugins/alsa09/ao_alsa09.c
+++ b/src/plugins/alsa09/ao_alsa09.c
@@ -336,8 +336,10 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format)
 	internal->cmd = "snd_pcm_open";
 	err = snd_pcm_open(&(internal->pcm_handle), internal->dev,
 			   SND_PCM_STREAM_PLAYBACK, 0);
-	if (err < 0)
+	if (err < 0) {
+		internal->pcm_handle = NULL;
 		goto error;
+	}
 
 	/* Set up the hardware parameters, ie sample and buffer specs */
 	err = alsa_set_hwparams(internal, format);
-- 
GitLab