OSDN Git Service

Fix a parse error in checkOutputForDevice
authorJohn Grossman <johngro@google.com>
Tue, 30 Oct 2012 01:42:43 +0000 (18:42 -0700)
committerJohn Grossman <johngro@google.com>
Tue, 30 Oct 2012 01:54:12 +0000 (18:54 -0700)
Fix a small parsing error in parsing the supported formats and sample
rates of a stream out with dynamic values for these parameters.  The
channel mask parser was properly skipping the "=" in the setting
string, but formats and sample rates were not (cauing the first
reported format and sample rate to end up being skipped)

Change-Id: Id227a44f6b5fc0c223f2ce74f94ebb6abc5fa77d
Signed-off-by: John Grossman <johngro@google.com>
audio/AudioPolicyManagerBase.cpp

index b4f4778..906c3fc 100644 (file)
@@ -1642,7 +1642,7 @@ status_t AudioPolicyManagerBase::checkOutputsForDevice(audio_devices_t device,
                                   reply.string());
                         value = strpbrk((char *)reply.string(), "=");
                         if (value != NULL) {
-                            loadSamplingRates(value, profile);
+                            loadSamplingRates(value + 1, profile);
                         }
                     }
                     if (profile->mFormats[0] == 0) {
@@ -1652,7 +1652,7 @@ status_t AudioPolicyManagerBase::checkOutputsForDevice(audio_devices_t device,
                                   reply.string());
                         value = strpbrk((char *)reply.string(), "=");
                         if (value != NULL) {
-                            loadFormats(value, profile);
+                            loadFormats(value + 1, profile);
                         }
                     }
                     if (profile->mChannelMasks[0] == 0) {