From: Android Build Merger (Role) Date: Fri, 11 May 2018 08:47:16 +0000 (+0000) Subject: [automerger] Camera: Initialize metadata padding field am: f85ced2263 X-Git-Tag: android-x86-9.0-r1~5^2^2^2^2^2^2^2^2^2^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4c34eb7ac8;hp=f85ced226300c5bb17124705a5931424474ded27;p=android-x86%2Fsystem-media.git [automerger] Camera: Initialize metadata padding field am: f85ced2263 Change-Id: Ic1b147fbf96aa567af9ea10533d0012a8765eca4 --- diff --git a/alsa_utils/alsa_device_profile.c b/alsa_utils/alsa_device_profile.c index dd238e74..054c77a6 100644 --- a/alsa_utils/alsa_device_profile.c +++ b/alsa_utils/alsa_device_profile.c @@ -288,6 +288,12 @@ static unsigned profile_enum_channel_counts(alsa_device_profile* profile, unsign profile->channel_counts[num_counts++] = std_channel_counts[index]; } } + // if we have no match with the standard counts, we use the largest (preferred) std count. + if (num_counts == 0) { + ALOGW("usb device does not match std channel counts, setting to %d", + std_channel_counts[0]); + profile->channel_counts[num_counts++] = std_channel_counts[0]; + } profile->channel_counts[num_counts] = 0; return num_counts; /* return # of supported counts */ }