diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-10-13 20:06:57 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-10-13 20:06:57 +0200 |
commit | 3ecdaa72534cae7afd0191902c57f9ac15b299d9 (patch) | |
tree | 86d4f188c26139ca2d6bfbac39c93bbb4c5f68f9 | |
parent | a0c0eedb1ea3d1bc3a058b45b5c7d2b7a36729ac (diff) | |
download | hardware_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.c | 9 | ||||
-rw-r--r-- | audio_out.c | 9 |
2 files changed, 18 insertions, 0 deletions
@@ -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, |