OSDN Git Service

Don't overwrite previous error in locator check
authorGlenn Kasten <gkasten@google.com>
Wed, 5 Jan 2011 21:58:31 +0000 (13:58 -0800)
committerGlenn Kasten <gkasten@google.com>
Thu, 6 Jan 2011 17:34:22 +0000 (09:34 -0800)
Change-Id: Ib7c2f1f34691160d881d4a2293b691e52ff01aa4

opensles/libopensles/data.c

index 99635c2..fc79f26 100644 (file)
@@ -227,7 +227,7 @@ static SLresult checkDataLocator(const char *name, void *pLocator, DataLocator *
 
         // Verify that another thread didn't change the locatorType field after we used it
         // to determine sizeof struct to copy.
-        if (locatorType != pDataLocator->mLocatorType) {
+        if ((SL_RESULT_SUCCESS == result) && (locatorType != pDataLocator->mLocatorType)) {
             SL_LOGE("%s: locatorType changed from %lu to %lu", name, locatorType,
                     pDataLocator->mLocatorType);
             result = SL_RESULT_PRECONDITIONS_VIOLATED;