- Timestamp:
- Nov 4, 2016 3:51:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r64579 r64581 1837 1837 if (!fActive) 1838 1838 { 1839 if (pThis->cStreamsActive) /* Disable can be called mupltiple times. */1840 pThis->cStreamsActive--;1841 1842 1839 # ifndef VBOX_WITH_AUDIO_HDA_CALLBACKS 1843 1840 hdaTimerMaybeStop(pThis); … … 1846 1843 else 1847 1844 { 1848 pThis->cStreamsActive++;1849 1845 # ifndef VBOX_WITH_AUDIO_HDA_CALLBACKS 1850 1846 hdaTimerMaybeStart(pThis); … … 4070 4066 static void hdaTimerMaybeStart(PHDASTATE pThis) 4071 4067 { 4072 if (pThis->cStreamsActive == 0) /* Only start the timer if there at least is one active streams. */ 4073 return; 4068 LogFlowFuncEnter(); 4074 4069 4075 4070 if (!pThis->pTimer) 4076 4071 return; 4077 4072 4073 pThis->cStreamsActive++; 4074 4075 /* Only start the timer at the first active stream. */ 4076 if (pThis->cStreamsActive == 1) 4077 { 4078 LogRel2(("HDA: Starting transfers\n")); 4079 4080 /* Set timer flag. */ 4081 ASMAtomicXchgBool(&pThis->fTimerActive, true); 4082 4083 /* Update current time timestamp. */ 4084 pThis->uTimerTS = TMTimerGet(pThis->pTimer); 4085 4086 /* Start transfers. */ 4087 hdaDoTransfers(pThis); 4088 } 4089 } 4090 4091 static void hdaTimerStop(PHDASTATE pThis) 4092 { 4078 4093 LogFlowFuncEnter(); 4079 4094 4080 LogRel2(("HDA: St arting transfers\n"));4095 LogRel2(("HDA: Stopping transfers\n")); 4081 4096 4082 4097 /* Set timer flag. */ 4083 ASMAtomicXchgBool(&pThis->fTimerActive, true); 4084 4085 /* Update current time timestamp. */ 4086 pThis->uTimerTS = TMTimerGet(pThis->pTimer); 4087 4088 /* Start transfers. */ 4089 hdaDoTransfers(pThis); 4098 ASMAtomicXchgBool(&pThis->fTimerActive, false); 4090 4099 } 4091 4100 4092 4101 static void hdaTimerMaybeStop(PHDASTATE pThis) 4093 4102 { 4094 if (pThis->cStreamsActive) /* Some streams still active? Bail out. */ 4095 return; 4103 LogFlowFuncEnter(); 4096 4104 4097 4105 if (!pThis->pTimer) 4098 4106 return; 4099 4107 4100 LogRel2(("HDA: Stopping transfers\n")); 4101 4102 /* Set timer flag. */ 4103 ASMAtomicXchgBool(&pThis->fTimerActive, false); 4108 if (pThis->cStreamsActive) /* Disable can be called mupltiple times. */ 4109 pThis->cStreamsActive--; 4110 4111 if (pThis->cStreamsActive == 0) 4112 hdaTimerStop(pThis); 4104 4113 } 4105 4114 … … 5524 5533 * Stop the timer, if any. 5525 5534 */ 5526 hdaTimerMaybeStop(pThis); 5535 hdaTimerStop(pThis); 5536 5537 pThis->cStreamsActive = 0; 5527 5538 # endif 5528 5539 … … 5616 5627 /* Emulation of codec "wake up" (HDA spec 5.5.1 and 6.5). */ 5617 5628 HDA_REG(pThis, STATESTS) = 0x1; 5618 5619 # ifndef VBOX_WITH_AUDIO_HDA_CALLBACKS5620 hdaTimerMaybeStart(pThis);5621 # endif5622 5629 5623 5630 LogFlowFuncLeave();
Note:
See TracChangeset
for help on using the changeset viewer.