VirtualBox

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#17769 closed defect (invalid)

tsStartNs sets bug

Reported by: gim Owned by:
Component: audio Version: VirtualBox 5.2.12
Keywords: Cc:
Guest type: all Host type: all

Description

pPeriod->Dbg.tsStartNs sets inside hdaR3StreamPeriodBegin only when LOG_ENABLED defined but uses in hdaR3StreamPeriodEnd without LOG_ENABLED define.

int hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
{
    Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE)); /* No nested calls. */

    pPeriod->fStatus          |= HDASTREAMPERIOD_FLAG_ACTIVE;
    pPeriod->u64StartWalClk    = u64WalClk;
    pPeriod->u64ElapsedWalClk  = 0;
    pPeriod->framesTransferred = 0;
    pPeriod->cIntPending       = 0;
# ifdef LOG_ENABLED
    pPeriod->Dbg.tsStartNs     = RTTimeNanoTS();
# endif

    Log3Func(("[SD%RU8] Starting @ %RU64 (%RU64 long)\n", pPeriod->u8SD, pPeriod->u64StartWalClk, pPeriod->u64DurationWalClk));
    return VINF_SUCCESS;
}

/**
 * Ends a formerly begun period life span.
 *
 * @param   pPeriod             Stream period to end life span for.
 */
void hdaR3StreamPeriodEnd(PHDASTREAMPERIOD pPeriod)
{
    Log3Func(("[SD%RU8] Took %zuus\n", pPeriod->u8SD, (RTTimeNanoTS() - pPeriod->Dbg.tsStartNs) / 1000));

...
}

Change History (2)

comment:1 by Valery Ushakov, 7 years ago

Resolution: invalid
Status: newclosed

This is not a problem. Log3Func() is also defined to expand to something only if LOG_ENABLED is defined, see include/iprt/log.h

comment:2 by gim, 7 years ago

Yep, my mistake

Note: See TracTickets for help on using tickets.

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