VirtualBox

Changeset 76022 in vbox


Ignore:
Timestamp:
Dec 6, 2018 4:13:29 PM (6 years ago)
Author:
vboxsync
Message:

Audio/HDA: Resolved a @todo in hdaR3SaveStream().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevHDA.cpp

    r76018 r76022  
    35913591        size_t cbBuf;
    35923592        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);
    35963594        if (cbBuf)
    35973595        {
    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)
    36053600            {
    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);
    36113602            }
    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        }
    36263604        RTCircBufReleaseReadBlock(pStream->State.pCircBuf, 0 /* Don't advance read pointer -- see comment above */);
    36273605    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette