Changeset 75983 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 5, 2018 4:35:32 PM (6 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r75980 r75983 402 402 403 403 /* Initialize position adjustment counter. */ 404 pStream->State.cPosAdjustFramesLeft = cfPosAdjust; 405 LogRel2(("HDA: Position adjustment for stream #%RU8 active (%RU32 frames)\n", pStream->u8SD, cfPosAdjust)); 404 pStream->State.cfPosAdjustDefault = cfPosAdjust; 405 pStream->State.cfPosAdjustLeft = pStream->State.cfPosAdjustDefault; 406 407 LogRel2(("HDA: Position adjustment for stream #%RU8 active (%RU32 frames)\n", 408 pStream->u8SD, pStream->State.cfPosAdjustDefault)); 406 409 } 407 410 } … … 507 510 pStream->pMixSink = hdaR3GetDefaultSink(pThis, uSD); 508 511 512 /* Reset position adjustment counter. */ 513 pStream->State.cfPosAdjustLeft = pStream->State.cfPosAdjustDefault; 514 509 515 /* Reset transfer stuff. */ 510 516 pStream->State.cbTransferProcessed = 0; … … 963 969 /* If there are position adjustment frames left to be processed, 964 970 * make sure that we process them first as a whole. */ 965 if (pStream->State.c PosAdjustFramesLeft)966 cbChunk = RT_MIN(cbChunk, uint32_t(pStream->State.c PosAdjustFramesLeft * pStream->State.Mapping.cbFrameSize));971 if (pStream->State.cfPosAdjustLeft) 972 cbChunk = RT_MIN(cbChunk, uint32_t(pStream->State.cfPosAdjustLeft * pStream->State.Mapping.cbFrameSize)); 967 973 968 974 Log3Func(("[SD%RU8] cbChunk=%RU32, cPosAdjustFramesLeft=%RU16\n", 969 pStream->u8SD, cbChunk, pStream->State.c PosAdjustFramesLeft));975 pStream->u8SD, cbChunk, pStream->State.cfPosAdjustLeft)); 970 976 971 977 if (!cbChunk) … … 1168 1174 /* Are we done doing the position adjustment? 1169 1175 * Only then do the transfer accounting .*/ 1170 if (pStream->State.c PosAdjustFramesLeft == 0)1176 if (pStream->State.cfPosAdjustLeft == 0) 1171 1177 { 1172 1178 Assert(cbLeft >= cbDMA); … … 1199 1205 * 1200 1206 * In such a case we need to skip such an interrupt and just move on. */ 1201 && pStream->State.c PosAdjustFramesLeft == 0)1207 && pStream->State.cfPosAdjustLeft == 0) 1202 1208 { 1203 1209 /* If the IOCE ("Interrupt On Completion Enable") bit of the SDCTL register is set … … 1226 1232 1227 1233 /* Do the position adjustment accounting. */ 1228 pStream->State.c PosAdjustFramesLeft -=1229 RT_MIN(pStream->State.c PosAdjustFramesLeft, cbDMA / pStream->State.Mapping.cbFrameSize);1234 pStream->State.cfPosAdjustLeft -= 1235 RT_MIN(pStream->State.cfPosAdjustLeft, cbDMA / pStream->State.Mapping.cbFrameSize); 1230 1236 1231 1237 if (RT_FAILURE(rc)) … … 1242 1248 /* Only do the data accounting if we don't have to do any position 1243 1249 * adjustment anymore. */ 1244 if (pStream->State.c PosAdjustFramesLeft == 0)1250 if (pStream->State.cfPosAdjustLeft == 0) 1245 1251 { 1246 1252 hdaR3StreamPeriodInc(pPeriod, RT_MIN(cbProcessed / pStream->State.Mapping.cbFrameSize, -
trunk/src/VBox/Devices/Audio/HDAStream.h
r75962 r75983 151 151 uint8_t cTransferPendingInterrupts; 152 152 uint8_t Padding2[4]; 153 /** Number of audio data frames for the position adjustment. 154 * 0 if no position adjustment is needed. */ 155 uint16_t cfPosAdjustDefault; 153 156 /** How many audio data frames are left to be processed 154 157 * for the position adjustment handling. 155 158 * 156 159 * 0 if position adjustment handling is done or inactive. */ 157 uint16_t cPosAdjustFramesLeft; 158 uint8_t Padding3[2]; 160 uint16_t cfPosAdjustLeft; 159 161 /** (Virtual) clock ticks per byte. */ 160 162 uint64_t cTicksPerByte;
Note:
See TracChangeset
for help on using the changeset viewer.