Changeset 70927 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 9, 2018 10:35:53 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r70926 r70927 136 136 /** Current read offset (in bytes) within the DSB. */ 137 137 DWORD offReadPos; 138 /** Number of buffer overruns happened. Used for logging. */ 139 uint8_t cOverruns; 138 140 } In; 139 141 struct … … 154 156 /** Timestamp (in ms) of When the last playback has happened. */ 155 157 uint64_t tsLastPlayMs; 158 /** Number of buffer underruns happened. Used for logging. */ 159 uint8_t cUnderruns; 156 160 } Out; 157 161 }; … … 922 926 Assert(pStreamDS->fEnabled == false); 923 927 928 pStreamDS->fEnabled = true; 929 924 930 pStreamDS->Out.fFirstPlayback = true; 925 pStreamDS-> fEnabled = true;931 pStreamDS->Out.cUnderruns = 0; 926 932 927 933 DSLOG(("DSound: Playback started\n")); … … 1317 1323 { 1318 1324 pStreamDS->fEnabled = true; 1325 1326 pStreamDS->In.cOverruns = 0; 1319 1327 } 1320 1328 else … … 1968 1976 1969 1977 uint32_t cbFree = (uint32_t)RTCircBufFree(pCircBuf); 1970 if (!cbFree) 1978 if ( !cbFree 1979 || pStreamDS->In.cOverruns < 32) /** @todo Make this configurable. */ 1980 { 1971 1981 DSLOG(("DSound: Warning: Capture buffer full, skipping to record data (%RU32 bytes)\n", cbUsed)); 1982 pStreamDS->In.cOverruns++; 1983 } 1972 1984 1973 1985 DWORD cbToCapture = RT_MIN(cbUsed, cbFree); … … 2066 2078 2067 2079 DWORD cbUsed = (uint32_t)RTCircBufUsed(pCircBuf); 2068 if (!cbUsed) 2080 if ( !cbUsed 2081 || pStreamDS->Out.cUnderruns < 32) /** @todo Make this configurable. */ 2082 { 2069 2083 DSLOG(("DSound: Warning: No more playback data available within time (%RU32 bytes free)\n", cbFree)); 2084 pStreamDS->Out.cUnderruns++; 2085 } 2070 2086 2071 2087 DWORD cbToPlay = RT_MIN(cbFree, cbUsed);
Note:
See TracChangeset
for help on using the changeset viewer.