diff options
Diffstat (limited to 'audio_in.c')
-rw-r--r-- | audio_in.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -247,7 +247,7 @@ static int audio_in_set_parameters(struct audio_stream *stream, const char *kvpa stream_in = (struct tinyalsa_audio_stream_in *) stream; - if(stream_in->device->mixer == NULL) + if(stream_in->device == NULL || stream_in->device->mixer == NULL) return -1; parms = str_parms_create_str(kvpairs); @@ -372,10 +372,18 @@ 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_stream_in *stream_in; struct tinyalsa_audio_device *tinyalsa_audio_device; LOGD("%s(%p)", __func__, stream); + stream_in = (struct tinyalsa_audio_stream_in *) stream; + +#ifdef YAMAHA_MC1N2_AUDIO + if(stream_in != NULL && !stream_in->standby) + yamaha_mc1n2_audio_input_stop(stream_in->device->mc1n2_pdata); +#endif + if(stream != NULL) free(stream); @@ -401,7 +409,7 @@ int audio_hw_open_input_stream(struct audio_hw_device *dev, LOGD("%s(%p, %d, %p, %p, %p, %d, %p)", __func__, dev, devices, format, channels, sample_rate, acoustics, stream_in); - if(dev == NULL) + if(dev == NULL || stream_in == NULL) return -EINVAL; tinyalsa_audio_device = (struct tinyalsa_audio_device *) dev; @@ -474,6 +482,8 @@ int audio_hw_open_input_stream(struct audio_hw_device *dev, error_stream: *stream_in = NULL; + free(tinyalsa_audio_stream_in); + tinyalsa_audio_device->stream_in = NULL; return -1; } |