OSDN Git Service

[automerger] Camera: Initialize metadata padding field am: f85ced2263
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>
Fri, 11 May 2018 08:47:16 +0000 (08:47 +0000)
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>
Fri, 11 May 2018 08:47:16 +0000 (08:47 +0000)
Change-Id: Ic1b147fbf96aa567af9ea10533d0012a8765eca4

alsa_utils/alsa_device_profile.c

index dd238e7..054c77a 100644 (file)
@@ -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 */
 }