- Timestamp:
- Nov 4, 2021 9:39:02 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r92209 r92210 2348 2348 memcpy(&pBeacon->Props, pProps, sizeof(PDMAUDIOPCMPROPS)); 2349 2349 2350 pBeacon->cb ToProcess= PDMAudioPropsFramesToBytes(&pBeacon->Props, AUDIOTEST_BEACON_SIZE_FRAMES);2350 pBeacon->cbSize = PDMAudioPropsFramesToBytes(&pBeacon->Props, AUDIOTEST_BEACON_SIZE_FRAMES); 2351 2351 } 2352 2352 … … 2380 2380 uint32_t AudioTestBeaconGetSize(PCAUDIOTESTTONEBEACON pBeacon) 2381 2381 { 2382 return pBeacon->cb ToProcess;2382 return pBeacon->cbSize; 2383 2383 } 2384 2384 … … 2402 2402 uint32_t AudioTestBeaconGetRemaining(PCAUDIOTESTTONEBEACON pBeacon) 2403 2403 { 2404 return pBeacon->cb ToProcess - pBeacon->cbProcessed;2404 return pBeacon->cbSize - pBeacon->cbUsed; 2405 2405 } 2406 2406 … … 2413 2413 uint32_t AudioTestBeaconGetUsed(PCAUDIOTESTTONEBEACON pBeacon) 2414 2414 { 2415 return pBeacon->cb Processed;2415 return pBeacon->cbUsed; 2416 2416 } 2417 2417 … … 2426 2426 int AudioTestBeaconWrite(PAUDIOTESTTONEBEACON pBeacon, void *pvBuf, uint32_t cbBuf) 2427 2427 { 2428 AssertReturn(pBeacon->cb Processed + cbBuf <= pBeacon->cbToProcess, VERR_BUFFER_OVERFLOW);2428 AssertReturn(pBeacon->cbUsed + cbBuf <= pBeacon->cbSize, VERR_BUFFER_OVERFLOW); 2429 2429 2430 2430 memset(pvBuf, AudioTestBeaconByteFromType(pBeacon->enmType), cbBuf); 2431 2431 2432 pBeacon->cb Processed += cbBuf;2432 pBeacon->cbUsed += cbBuf; 2433 2433 2434 2434 return VINF_SUCCESS; … … 2483 2483 2484 2484 unsigned const cbStep = cbFrameSize; 2485 uint32_t const cbProcessedInitial = pBeacon->cb Processed;2485 uint32_t const cbProcessedInitial = pBeacon->cbUsed; 2486 2486 2487 2487 for (size_t i = 0; i < cbBuf; i += cbStep) … … 2494 2494 if (offGap) 2495 2495 { 2496 pBeacon->cb Processed = 0;2496 pBeacon->cbUsed = 0; 2497 2497 } 2498 pBeacon->cb Processed += cbStep;2498 pBeacon->cbUsed += cbStep; 2499 2499 offGap = 0; 2500 2500 } … … 2503 2503 } 2504 2504 2505 Assert(pBeacon->cb Processed >= cbProcessedInitial);2506 return pBeacon->cb Processed - cbProcessedInitial;2505 Assert(pBeacon->cbUsed >= cbProcessedInitial); 2506 return pBeacon->cbUsed - cbProcessedInitial; 2507 2507 } 2508 2508 … … 2517 2517 bool AudioTestBeaconIsComplete(PCAUDIOTESTTONEBEACON pBeacon) 2518 2518 { 2519 AssertReturn(pBeacon->cb Processed <= pBeacon->cbToProcess, true);2520 return (pBeacon->cb Processed == pBeacon->cbToProcess);2519 AssertReturn(pBeacon->cbUsed <= pBeacon->cbSize, true); 2520 return (pBeacon->cbUsed == pBeacon->cbSize); 2521 2521 } 2522 2522 -
trunk/src/VBox/Devices/Audio/AudioTest.h
r92195 r92210 154 154 * When doing test tone playback: Beacon bytes to write. 155 155 * When doing test tone recording: Beacon bytes to read. */ 156 uint32_t cb ToProcess;156 uint32_t cbSize; 157 157 /** Beacon bytes already processed. 158 158 * When doing test tone playback: Beacon bytes written. 159 159 * When doing test tone recording: Beacon bytes read. */ 160 uint32_t cb Processed;160 uint32_t cbUsed; 161 161 } AUDIOTESTTONEBEACON; 162 162 /** Pointer to audio test tone beacon. */
Note:
See TracChangeset
for help on using the changeset viewer.