Changeset 91643 in vbox
- Timestamp:
- Oct 8, 2021 2:16:17 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 147368
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r91641 r91643 2245 2245 uint32_t const cbChunkSize = PDMAudioPropsFrameSize(&pToneParms->Props); /* Use the audio frame size as chunk size. */ 2246 2246 2247 uint64_t offCur = 0; 2248 uint64_t offLastDiff = UINT64_MAX; 2249 uint64_t cbSize = RT_MIN(pCmpA->cbSize, pCmpB->cbSize); 2250 uint64_t cbToCompare = cbSize; 2247 uint64_t offCur = 0; 2248 uint64_t offDiffStart = 0; 2249 bool fInDiff = false; 2250 uint64_t cbSize = RT_MIN(pCmpA->cbSize, pCmpB->cbSize); 2251 uint64_t cbToCompare = cbSize; 2251 2252 2252 2253 while (cbToCompare) … … 2262 2263 if (memcmp(auBufA, auBufB, RT_MIN(cbReadA, cbReadB)) != 0) 2263 2264 { 2264 if ( offLastDiff == UINT64_MAX) /* No consequitive different chunk? Count as new then. */2265 if (!fInDiff) /* No consequitive different chunk? Count as new then. */ 2265 2266 { 2266 2267 cDiffs++; 2267 offLastDiff = offCur; 2268 offDiffStart = offCur; 2269 fInDiff = true; 2268 2270 } 2269 2271 } 2270 2272 else /* Reset and count next difference as new then. */ 2271 2273 { 2272 if ( cDiffs)2274 if (fInDiff) 2273 2275 { 2274 uint32_t const cbDiff = offCur - off LastDiff;2276 uint32_t const cbDiff = offCur - offDiffStart; 2275 2277 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)", 2276 pCmpA->offStart, pCmpB->offStart, off LastDiff, offCur,2278 pCmpA->offStart, pCmpB->offStart, offDiffStart, offCur, 2277 2279 cbDiff, PDMAudioPropsBytesToMilli(&pToneParms->Props, cbDiff)); 2278 2280 AssertRC(rc2); … … 2280 2282 cbDiffs += cbDiff; 2281 2283 } 2282 offLastDiff = UINT64_MAX;2284 fInDiff = false; 2283 2285 } 2284 2286 … … 2289 2291 2290 2292 /* If we didn't mention the last diff yet, do so now. */ 2291 if ( offLastDiff != UINT64_MAX 2292 && cDiffs) 2293 { 2294 uint32_t const cbDiff = offCur - offLastDiff; 2293 if (fInDiff) 2294 { 2295 uint32_t const cbDiff = offCur - offDiffStart; 2295 2296 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A @ %#x vs. B @ %#x [%08RU64-%08RU64] (%RU64 bytes, %RU64ms)", 2296 pCmpA->offStart, pCmpB->offStart, off LastDiff, offCur,2297 pCmpA->offStart, pCmpB->offStart, offDiffStart, offCur, 2297 2298 cbDiff, PDMAudioPropsBytesToMilli(&pToneParms->Props, cbDiff)); 2298 2299 AssertRC(rc2); … … 2301 2302 } 2302 2303 2303 if (cbDiffs) 2304 { 2305 uint8_t const uDiffPercent = (cbSize * 100) / cbDiffs; 2304 if ( cbSize 2305 && cbDiffs) 2306 { 2307 uint8_t const uDiffPercent = cbDiffs / (cbSize * 100); 2306 2308 if (uDiffPercent > pVerJob->Opts.uMaxDiffPercent) 2307 2309 {
Note:
See TracChangeset
for help on using the changeset viewer.