- Timestamp:
- Aug 7, 2018 3:34:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r73547 r73550 154 154 /** Flag indicating whether playback was just (re)started. */ 155 155 bool fFirstTransfer; 156 /** Flag indicating whether this stream is in draining mode, e.g. no new 157 * data is being written to it but DirectSound still needs to be able to 158 * play its remaining (buffered) data. */ 159 bool fDrain; 156 160 /** How much (in bytes) the last transfer from the internal buffer 157 161 * to the DirectSound buffer was. */ … … 851 855 if (!pStreamDS->Dbg.tsLastTransferredMs) 852 856 pStreamDS->Dbg.tsLastTransferredMs = RTTimeMilliTS(); 853 Log3Func(("tsLastTransferredMs=%RU64ms, cbAvail=%RU32, cbFree=%RU32 -> cbToTransfer=%RU32 \n",854 RTTimeMilliTS() - pStreamDS->Dbg.tsLastTransferredMs, cbAvail, cbFree, cbToTransfer ));857 Log3Func(("tsLastTransferredMs=%RU64ms, cbAvail=%RU32, cbFree=%RU32 -> cbToTransfer=%RU32 (fDrain=%RTbool)\n", 858 RTTimeMilliTS() - pStreamDS->Dbg.tsLastTransferredMs, cbAvail, cbFree, cbToTransfer, pStreamDS->Out.fDrain)); 855 859 pStreamDS->Dbg.tsLastTransferredMs = RTTimeMilliTS(); 856 860 #endif 857 861 858 #if 0 859 if (cbToTransfer > cbAvail) /* Paranoia. */ 860 cbToTransfer = cbAvail; 861 862 if (cbToTransfer > cbFree) 863 cbToTransfer = cbFree; 864 #endif 862 /* Only transfer anything if we have enough data for a DirectSound stream's period *and* are not 863 * in draining mode (already). */ 864 if ( !pStreamDS->Out.fDrain 865 && cbToTransfer < DrvAudioHlpFramesToBytes(pStreamDS->Cfg.Backend.cfPeriod, &pStreamDS->Cfg.Props)) 866 return VINF_SUCCESS; 865 867 866 868 while (cbToTransfer) … … 1760 1762 pStreamDS->Out.cbTransferred = 0; 1761 1763 pStreamDS->Out.fFirstTransfer = true; 1764 pStreamDS->Out.fDrain = false; 1762 1765 pStreamDS->Out.cbLastTransferred = 0; 1763 1766 pStreamDS->Out.tsLastTransferred = 0; … … 1811 1814 { 1812 1815 /* Make sure we transferred everything. */ 1816 pStreamDS->Out.fDrain = true; 1813 1817 rc = dsoundPlayTransfer(pThis); 1814 1818 if ( RT_SUCCESS(rc)
Note:
See TracChangeset
for help on using the changeset viewer.