summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-10-13 20:06:57 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-10-13 20:06:57 +0200
commit3ecdaa72534cae7afd0191902c57f9ac15b299d9 (patch)
tree86d4f188c26139ca2d6bfbac39c93bbb4c5f68f9
parenta0c0eedb1ea3d1bc3a058b45b5c7d2b7a36729ac (diff)
downloadhardware_tinyalsa-audio-3ecdaa72534cae7afd0191902c57f9ac15b299d9.zip
hardware_tinyalsa-audio-3ecdaa72534cae7afd0191902c57f9ac15b299d9.tar.gz
hardware_tinyalsa-audio-3ecdaa72534cae7afd0191902c57f9ac15b299d9.tar.bz2
Output/Input: Clean TinyALSA Audio Device pointer on close
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--audio_in.c9
-rw-r--r--audio_out.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/audio_in.c b/audio_in.c
index 44c47e8..fd3c836 100644
--- a/audio_in.c
+++ b/audio_in.c
@@ -157,10 +157,19 @@ static int audio_in_remove_audio_effect(const struct audio_stream *stream, effec
void audio_hw_close_input_stream(struct audio_hw_device *dev,
struct audio_stream_in *stream)
{
+ struct tinyalsa_audio_device *tinyalsa_audio_device;
+
LOGD("%s(%p)", __func__, stream);
if(stream != NULL)
free(stream);
+
+ if(dev == NULL)
+ return;
+
+ tinyalsa_audio_device = (struct tinyalsa_audio_device *) dev;
+
+ tinyalsa_audio_device->stream_in = NULL;
}
int audio_hw_open_input_stream(struct audio_hw_device *dev,
diff --git a/audio_out.c b/audio_out.c
index a0bad83..13a71a5 100644
--- a/audio_out.c
+++ b/audio_out.c
@@ -380,10 +380,19 @@ static int audio_out_remove_audio_effect(const struct audio_stream *stream, effe
void audio_hw_close_output_stream(struct audio_hw_device *dev,
struct audio_stream_out *stream)
{
+ struct tinyalsa_audio_device *tinyalsa_audio_device;
+
LOGD("%s(%p)", __func__, stream);
if(stream != NULL)
free(stream);
+
+ if(dev == NULL)
+ return;
+
+ tinyalsa_audio_device = (struct tinyalsa_audio_device *) dev;
+
+ tinyalsa_audio_device->stream_out = NULL;
}
int audio_hw_open_output_stream(struct audio_hw_device *dev,