VirtualBox

Ignore:
Timestamp:
Jan 18, 2019 10:19:01 AM (6 years ago)
Author:
vboxsync
Message:

Audio/AC97: Simplified ichac97R3StreamTransferCalcNext() a lot, making the A/V synchronization work.

File:
1 edited

Legend:

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

    r76863 r76880  
    19701970        return 0;
    19711971
    1972     AssertReturn(DrvAudioHlpPCMPropsAreValid(&pStream->State.Cfg.Props), 0);
    1973     const uint32_t cbFrame = DrvAudioHlpPCMPropsBytesPerFrame(&pStream->State.Cfg.Props);
    1974 
    1975     AssertReturn(cbBytes % cbFrame == 0, 0);
    1976 
    1977     const uint64_t cTicksPerHz    = TMTimerGetFreq((pThis)->DEVAC97_CTX_SUFF_SD(pTimer, pStream->u8SD)) / pStream->State.uTimerHz;
    1978     const uint64_t cTicksPerByte  = cTicksPerHz / cbBytes;
    1979     Assert(cTicksPerByte);
    1980     const uint64_t cTransferTicks = cbBytes * cTicksPerByte;
    1981 
    1982     LogFunc(("[SD%RU8] Timer %uHz (%RU64 ticks per Hz), cTicksPerByte=%RU64, cbBytes=%RU32 -> cTransferTicks=%RU64\n",
    1983              pStream->u8SD, pStream->State.uTimerHz, cTicksPerHz, cTicksPerByte, cbBytes, cTransferTicks));
     1972    const uint64_t usBytes        = DrvAudioHlpBytesToMicro(cbBytes, &pStream->State.Cfg.Props);
     1973    const uint64_t cTransferTicks = TMTimerFromMicro((pThis)->DEVAC97_CTX_SUFF_SD(pTimer, pStream->u8SD), usBytes);
     1974
     1975    LogFunc(("[SD%RU8] Timer %uHz, cbBytes=%RU32 -> usBytes=%RU64, cTransferTicks=%RU64\n",
     1976             pStream->u8SD, pStream->State.uTimerHz, cbBytes, usBytes, cTransferTicks));
    19841977
    19851978    return cTransferTicks;
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