Changeset 65669 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 7, 2017 5:27:51 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r65668 r65669 169 169 } 170 170 171 uint32_t c sRead;171 uint32_t cRead; 172 172 if (pMixBuf->offRead + cSamplesToRead > pMixBuf->cSamples) 173 173 { 174 c sRead = pMixBuf->cSamples - pMixBuf->offRead;174 cRead = pMixBuf->cSamples - pMixBuf->offRead; 175 175 rc = VINF_TRY_AGAIN; 176 176 } 177 177 else 178 178 { 179 c sRead = cSamplesToRead;179 cRead = cSamplesToRead; 180 180 rc = VINF_SUCCESS; 181 181 } 182 182 183 if (c sRead > cSampleBuf)184 { 185 c sRead = cSampleBuf;183 if (cRead > cSampleBuf) 184 { 185 cRead = cSampleBuf; 186 186 rc = VINF_TRY_AGAIN; 187 187 } 188 188 189 if (c sRead)190 { 191 memcpy(paSampleBuf, &pMixBuf->pSamples[pMixBuf->offRead], sizeof(PDMAUDIOSAMPLE) * c sRead);192 193 pMixBuf->offRead = (pMixBuf->offRead + c sRead) % pMixBuf->cSamples;189 if (cRead) 190 { 191 memcpy(paSampleBuf, &pMixBuf->pSamples[pMixBuf->offRead], sizeof(PDMAUDIOSAMPLE) * cRead); 192 193 pMixBuf->offRead = (pMixBuf->offRead + cRead) % pMixBuf->cSamples; 194 194 Assert(pMixBuf->offRead <= pMixBuf->cSamples); 195 pMixBuf->cUsed -= RT_MIN(c sRead, pMixBuf->cUsed);195 pMixBuf->cUsed -= RT_MIN(cRead, pMixBuf->cUsed); 196 196 } 197 197 198 198 if (pcSamplesRead) 199 *pcSamplesRead = c sRead;199 *pcSamplesRead = cRead; 200 200 201 201 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.