- Timestamp:
- May 4, 2015 2:49:21 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100025
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r55269 r55650 216 216 AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER); 217 217 218 /*219 * Just call the VRDP server with the data.220 */221 218 uint32_t live = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */); 222 219 uint64_t now = PDMDrvHlpTMGetVirtualTime(pDrv->pDrvIns); … … 224 221 uint64_t ticks_per_second = PDMDrvHlpTMGetVirtualFreq(pDrv->pDrvIns); 225 222 223 /* Minimize the rounding error: samples = int((ticks * freq) / ticks_per_second + 0.5). */ 226 224 uint32_t cSamplesPlayed = (int)((2 * ticks * pHstStrmOut->Props.uHz + ticks_per_second) / ticks_per_second / 2); 227 if (!cSamplesPlayed) 225 226 /* Don't play more than available. */ 227 if (cSamplesPlayed > live) 228 228 cSamplesPlayed = live; 229 230 /* Remember when samples were consumed. */ 231 pVRDEStrmOut->old_ticks = now; 229 232 230 233 VRDEAUDIOFORMAT format = VRDE_AUDIO_FMT_MAKE(pHstStrmOut->Props.uHz, … … 233 236 pHstStrmOut->Props.fSigned); 234 237 235 pVRDEStrmOut->old_ticks = now; 236 237 int cSamplesToSend = live; 238 239 /* if (!cSamplesToSend) 240 { 241 if (pcSamplesPlayed) 242 pcSamplesPlayed = 0; 243 244 return 0; 245 }*/ 238 int cSamplesToSend = cSamplesPlayed; 246 239 247 240 LogFlowFunc(("uFreq=%RU32, cChan=%RU8, cBits=%RU8, fSigned=%RTbool, enmFormat=%ld, cSamplesToSend=%RU32\n", … … 250 243 format, cSamplesToSend)); 251 244 245 /* 246 * Call the VRDP server with the data. 247 */ 252 248 uint32_t cReadTotal = 0; 253 249
Note:
See TracChangeset
for help on using the changeset viewer.