diff options
author | Haynes Mathew George <hgeorge@codeaurora.org> | 2014-12-12 20:21:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-12 20:21:30 +0000 |
commit | 43aaf6d97edbd811f479312ea4f93754b2305cea (patch) | |
tree | bb47e2068239d365f58310e2de255477df5a86fc | |
parent | 6cc4df12451931e128e449e7976c6b5c5225e6dd (diff) | |
parent | 5c8b899d7c80f012599b984143cb31334ee61372 (diff) | |
download | hardware_libhardware-43aaf6d97edbd811f479312ea4f93754b2305cea.zip hardware_libhardware-43aaf6d97edbd811f479312ea4f93754b2305cea.tar.gz hardware_libhardware-43aaf6d97edbd811f479312ea4f93754b2305cea.tar.bz2 |
am 5c8b899d: am 2cbdfa9c: usbaudio: reset profile on device disconnect
* commit '5c8b899d7c80f012599b984143cb31334ee61372':
usbaudio: reset profile on device disconnect
-rw-r--r-- | modules/usbaudio/alsa_device_profile.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/usbaudio/alsa_device_profile.c b/modules/usbaudio/alsa_device_profile.c index 5c4edd1..8e84471 100644 --- a/modules/usbaudio/alsa_device_profile.c +++ b/modules/usbaudio/alsa_device_profile.c @@ -58,10 +58,9 @@ extern int8_t const pcm_format_value_map[50]; static const unsigned std_sample_rates[] = {48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}; -void profile_init(alsa_device_profile* profile, int direction) +static void profile_reset(alsa_device_profile* profile) { profile->card = profile->device = -1; - profile->direction = direction; /* Fill the attribute arrays with invalid values */ size_t index; @@ -83,6 +82,12 @@ void profile_init(alsa_device_profile* profile, int direction) profile->is_valid = false; } +void profile_init(alsa_device_profile* profile, int direction) +{ + profile->direction = direction; + profile_reset(profile); +} + bool profile_is_initialized(alsa_device_profile* profile) { return profile->card >= 0 && profile->device >= 0; @@ -97,7 +102,7 @@ bool profile_is_cached_for(alsa_device_profile* profile, int card, int device) { } void profile_decache(alsa_device_profile* profile) { - profile->card = profile->device = -1; + profile_reset(profile); } /* |