diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-10-26 19:04:10 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-10-26 19:04:10 +0200 |
commit | c949a1dc724a9727cecf28ed980f316094e9f828 (patch) | |
tree | 17b217ac7c7a59289e67aabc7d8980a107c5972e | |
parent | 5f903f20d812bfbec535d9432ce8f4d357097e58 (diff) | |
download | hardware_tinyalsa-audio-c949a1dc724a9727cecf28ed980f316094e9f828.zip hardware_tinyalsa-audio-c949a1dc724a9727cecf28ed980f316094e9f828.tar.gz hardware_tinyalsa-audio-c949a1dc724a9727cecf28ed980f316094e9f828.tar.bz2 |
Assign streams to tinyalsa_audio_device, don't disable-enable the same path
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | audio_in.c | 1 | ||||
-rw-r--r-- | audio_out.c | 1 | ||||
-rw-r--r-- | mixer.c | 6 |
3 files changed, 7 insertions, 1 deletions
@@ -411,6 +411,7 @@ int audio_hw_open_input_stream(struct audio_hw_device *dev, return -ENOMEM; tinyalsa_audio_stream_in->device = tinyalsa_audio_device; + tinyalsa_audio_device->stream_in = tinyalsa_audio_stream_in; stream = &(tinyalsa_audio_stream_in->stream); stream->common.get_sample_rate = audio_in_get_sample_rate; diff --git a/audio_out.c b/audio_out.c index 969c8f6..573dd4e 100644 --- a/audio_out.c +++ b/audio_out.c @@ -432,6 +432,7 @@ int audio_hw_open_output_stream(struct audio_hw_device *dev, return -ENOMEM; tinyalsa_audio_stream_out->device = tinyalsa_audio_device; + tinyalsa_audio_device->stream_out = tinyalsa_audio_stream_out; stream = &(tinyalsa_audio_stream_out->stream); stream->common.get_sample_rate = audio_out_get_sample_rate; @@ -752,6 +752,10 @@ int tinyalsa_mixer_set_route(struct tinyalsa_mixer *mixer, goto error_mixer; } + // No need to disable and enable the same route + if(mixer_device == mixer_io->device_current) + goto exit_mixer; + if(mixer_io->device_current != NULL) { rc = tinyalsa_mixer_set_route_list(mixer, mixer_io->device_current->disable); if(rc < 0) { @@ -768,6 +772,7 @@ int tinyalsa_mixer_set_route(struct tinyalsa_mixer *mixer, mixer_io->device_current = mixer_device; +exit_mixer: mixer_close(mixer->mixer); mixer->mixer = NULL; @@ -1028,7 +1033,6 @@ int tinyalsa_mixer_set_state(struct tinyalsa_mixer *mixer, mixer_io->device_current = NULL; mixer_io->state = state; -exit_mixer: mixer_close(mixer->mixer); mixer->mixer = NULL; |