Changeset 76022 in vbox
- Timestamp:
- Dec 6, 2018 4:13:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r76018 r76022 3591 3591 size_t cbBuf; 3592 3592 RTCircBufAcquireReadBlock(pStream->State.pCircBuf, cbCircBufUsed, &pvBuf, &cbBuf); 3593 #if 0 /** @todo r=bird: The disabled code crashes on me. The #else case contains something that seems 3594 * to make more sense to me. I'm not saying this is necessarily correct, so please review, fix, and remove. */ 3595 3593 Assert(cbBuf); 3596 3594 if (cbBuf) 3597 3595 { 3598 size_t cbToRead = cbCircBufUsed; 3599 size_t cbEnd = 0; 3600 3601 if (cbCircBufUsed > offBuf) 3602 cbEnd = cbCircBufUsed - offBuf; 3603 3604 if (cbEnd) /* Save end of buffer first. */ 3596 rc = SSMR3PutMem(pSSM, pvBuf, cbBuf); 3597 AssertRC(rc); 3598 if ( RT_SUCCESS(rc) 3599 && cbBuf < cbCircBufUsed) 3605 3600 { 3606 rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf + cbCircBufSize - cbEnd /* End of buffer */, cbEnd); 3607 AssertRCReturn(rc, rc); 3608 3609 Assert(cbToRead >= cbEnd); 3610 cbToRead -= cbEnd; 3601 rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf - offBuf, cbCircBufUsed - cbBuf); 3611 3602 } 3612 3613 if (cbToRead) /* Save remaining stuff at start of buffer (if any). */ 3614 { 3615 rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf - cbCircBufUsed /* Start of buffer */, cbToRead); 3616 AssertRCReturn(rc, rc); 3617 } 3618 } 3619 3620 #else 3621 Assert(cbBuf); 3622 rc = SSMR3PutMem(pSSM, pvBuf, cbBuf); 3623 if (cbBuf < cbCircBufUsed) 3624 rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf - offBuf, cbCircBufUsed - cbBuf); 3625 #endif 3603 } 3626 3604 RTCircBufReleaseReadBlock(pStream->State.pCircBuf, 0 /* Don't advance read pointer -- see comment above */); 3627 3605 }
Note:
See TracChangeset
for help on using the changeset viewer.