Changeset 57827 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Sep 18, 2015 12:53:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
r57451 r57827 57 57 PDMAUDIOHSTSTRMOUT hw; 58 58 uint64_t u64TicksLast; 59 uint64_t csPlayBuffer; 60 uint8_t *pu8PlayBuffer; 59 61 } NULLAUDIOSTREAMOUT; 60 62 … … 132 134 NULLAUDIOSTREAMOUT *pNullStrmOut = (NULLAUDIOSTREAMOUT *)pHstStrmOut; 133 135 pNullStrmOut->u64TicksLast = 0; 134 if (pcSamples) 135 *pcSamples = _1K; 136 pNullStrmOut->csPlayBuffer = _1K; 137 pNullStrmOut->pu8PlayBuffer = (uint8_t *)RTMemAlloc(_1K << pHstStrmOut->Props.cShift); 138 if (pNullStrmOut->pu8PlayBuffer) 139 { 140 if (pcSamples) 141 *pcSamples = pNullStrmOut->csPlayBuffer; 142 } 143 else 144 { 145 rc = VERR_NO_MEMORY; 146 } 136 147 } 137 148 … … 170 181 cSamplesPlayed = csLive; 171 182 172 AudioMixBufFinish(&pHstStrmOut->MixBuf, cSamplesPlayed); 183 cSamplesPlayed = RT_MIN(cSamplesPlayed, pNullStrmOut->csPlayBuffer); 184 185 uint32_t csRead = 0; 186 AudioMixBufReadCirc(&pHstStrmOut->MixBuf, pNullStrmOut->pu8PlayBuffer, cSamplesPlayed << pHstStrmOut->Props.cShift, &csRead); 187 AudioMixBufFinish(&pHstStrmOut->MixBuf, csRead); 173 188 174 189 if (pcSamplesPlayed) 175 *pcSamplesPlayed = c SamplesPlayed;190 *pcSamplesPlayed = csRead; 176 191 177 192 return VINF_SUCCESS; … … 215 230 static DECLCALLBACK(int) drvHostNullAudioFiniOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut) 216 231 { 232 NULLAUDIOSTREAMOUT *pNullStrmOut = (NULLAUDIOSTREAMOUT *)pHstStrmOut; 233 RTMemFree(pNullStrmOut->pu8PlayBuffer); 217 234 return VINF_SUCCESS; 218 235 }
Note:
See TracChangeset
for help on using the changeset viewer.