VirtualBox

Changeset 46553 in vbox for trunk


Ignore:
Timestamp:
Jun 14, 2013 12:15:06 PM (12 years ago)
Author:
vboxsync
Message:

Main/VPX: more race fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/VideoRec.cpp

    r46549 r46553  
    4949    VIDREC_COPYING = 2,
    5050    /* signal that we are terminating */
    51     VIDREC_TERMINATING = 2
     51    VIDREC_TERMINATING = 3
    5252};
    5353static uint32_t g_enmState = VIDREC_UNINITIALIZED;
     
    394394        {
    395395            PVIDEORECSTREAM pStrm = &pCtx->Strm[uScreen];
    396             if (ASMAtomicReadBool(&pStrm->fRgbFilled))
     396            if (   pStrm->fEnabled
     397                && ASMAtomicReadBool(&pStrm->fRgbFilled))
    397398            {
    398399                rc = videoRecRGBToYUV(pStrm);
     
    590591bool VideoRecIsEnabled(PVIDEORECCONTEXT pCtx)
    591592{
    592     if (!pCtx)
    593         return false;
    594 
    595     return pCtx->fEnabled;
     593    uint32_t enmState = ASMAtomicReadU32(&g_enmState);
     594    return (   enmState == VIDREC_IDLE
     595            || enmState == VIDREC_COPYING);
    596596}
    597597
     
    720720
    721721        PVIDEORECSTREAM pStrm = &pCtx->Strm[uScreen];
    722 
     722        if (!pStrm->fEnabled)
     723        {
     724            rc = VINF_TRY_AGAIN; /* not (yet) enabled */
     725            break;
     726        }
    723727        if (u64TimeStamp < pStrm->u64LastTimeStamp + pStrm->uDelay)
    724728        {
     
    726730            break;
    727731        }
    728 
    729732        if (ASMAtomicReadBool(&pStrm->fRgbFilled))
    730733        {
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