Changeset 67462 in vbox for trunk/src/VBox
- Timestamp:
- Jun 19, 2017 10:05:03 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r67442 r67462 5471 5471 #endif 5472 5472 /* How much (guest output) data is available at the moment? */ 5473 uint32_t cb ToRead= hdaStreamGetUsed(pStream);5473 uint32_t cbAvailable = hdaStreamGetUsed(pStream); 5474 5474 5475 5475 /* Do not write more than the sink can hold at the moment. 5476 5476 * The host sets the overall pace. */ 5477 if (cb ToRead> cbWritable)5478 cb ToRead= cbWritable;5479 5480 if (cb ToRead)5477 if (cbAvailable > cbWritable) 5478 cbAvailable = cbWritable; 5479 5480 if (cbAvailable) 5481 5481 { 5482 5482 /* Read (guest output) data and write it to the stream's sink. */ 5483 rc2 = hdaStreamRead(pThis, pStream, cb ToRead, NULL /* pcbRead */);5483 rc2 = hdaStreamRead(pThis, pStream, cbAvailable, NULL /* pcbRead */); 5484 5484 AssertRC(rc2); 5485 5485 } … … 5511 5511 const uint32_t cbReadable = AudioMixerSinkGetReadable(pSink); 5512 5512 5513 Log3Func(("[SD%RU8] cbReadable=%RU32\n", pStream->u8SD, cbReadable));5514 5515 5513 /* How much (guest input) data is free at the moment? */ 5516 uint32_t cbToWrite = hdaStreamGetFree(pStream); 5514 uint32_t cbFree = hdaStreamGetFree(pStream); 5515 5516 Log3Func(("[SD%RU8] cbReadable=%RU32, cbFree=%RU32\n", pStream->u8SD, cbReadable, cbFree)); 5517 5517 5518 5518 /* Do not read more than the sink can provide at the moment. 5519 5519 * The host sets the overall pace. */ 5520 if (cb ToWrite > cbReadable)5521 cb ToWrite = cbReadable;5522 5523 if (cb ToWrite)5520 if (cbFree > cbReadable) 5521 cbFree = cbReadable; 5522 5523 if (cbFree) 5524 5524 { 5525 5525 /* Write (guest input) data to the stream which was read from stream's sink before. */ 5526 rc2 = hdaStreamWrite(pThis, pStream, cb ToWrite, NULL /* pcbWritten */);5526 rc2 = hdaStreamWrite(pThis, pStream, cbFree, NULL /* pcbWritten */); 5527 5527 AssertRC(rc2); 5528 5528 }
Note:
See TracChangeset
for help on using the changeset viewer.