Changeset 89333 in vbox for trunk/src/VBox/Devices/Audio/testcase
- Timestamp:
- May 28, 2021 8:31:50 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r89332 r89333 272 272 for (uint32_t i = 0; i < cToWrite; i++) 273 273 { 274 RTTESTI_CHECK_RC_OK(AudioMixBufWriteCirc(&mb, &aFrames16, sizeof(aFrames16), &cFramesWritten));274 AudioMixBufWrite(&mb, &WrState, &aFrames16[0], sizeof(aFrames16), 0 /*offDstFrame*/, 1, &cFramesWritten); 275 275 RTTESTI_CHECK(cFramesWritten == 1); 276 AudioMixBufCommit(&mb, cFramesWritten); 276 277 } 277 278 RTTESTI_CHECK(!AudioMixBufIsEmpty(&mb)); … … 280 281 RTTESTI_CHECK(AudioMixBufUsed(&mb) == cToWrite + cFramesWrittenAbs /* + last absolute write */); 281 282 282 RTTESTI_CHECK_RC_OK(AudioMixBufWriteCirc(&mb, &aFrames16, sizeof(aFrames16), &cFramesWritten));283 AudioMixBufWrite(&mb, &WrState, &aFrames16[0], sizeof(aFrames16), 0 /*offDstFrame*/, 1, &cFramesWritten); 283 284 RTTESTI_CHECK(cFramesWritten == 1); 285 AudioMixBufCommit(&mb, cFramesWritten); 284 286 RTTESTI_CHECK(AudioMixBufFree(&mb) == 0); 285 287 RTTESTI_CHECK(AudioMixBufFreeBytes(&mb) == AUDIOMIXBUF_F2B(&mb, 0U)); … … 572 574 RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInit(&MixBuf, "NewPeekMixBuf", &CfgSrc, cFrames)); 573 575 576 /* Write state (source). */ 577 AUDIOMIXBUFWRITESTATE WriteState; 578 RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInitWriteState(&MixBuf, &WriteState, &CfgSrc)); 579 574 580 /* Peek state (destination) is uToHz 2ch S16 */ 575 581 PDMAUDIOPCMPROPS const CfgDst = PDMAUDIOPCMPROPS_INITIALIZER(2 /*cbSample*/, true /*fSigned*/, 2 /*ch*/, uToHz, false /*fSwap*/); … … 607 613 608 614 uint32_t cSrcFramesWritten = UINT32_MAX / 2; 609 RTTESTI_CHECK_RC_OK_BREAK(AudioMixBufWriteCirc(&MixBuf, &aSrcFrames, cSrcFrames * sizeof(aSrcFrames[0]), &cSrcFramesWritten)); 615 AudioMixBufWrite(&MixBuf, &WriteState, &aSrcFrames[0], cSrcFrames * sizeof(aSrcFrames[0]), 616 0 /*offDstFrame*/, cSrcFrames, &cSrcFramesWritten); 610 617 RTTESTI_CHECK_MSG_BREAK(cSrcFrames == cSrcFramesWritten, 611 618 ("cSrcFrames=%RU32 vs cSrcFramesWritten=%RU32 cLiveFrames=%RU32\n", 612 619 cSrcFrames, cSrcFramesWritten, AudioMixBufLive(&MixBuf))); 620 AudioMixBufCommit(&MixBuf, cSrcFrames); 613 621 614 622 /*
Note:
See TracChangeset
for help on using the changeset viewer.