Changeset 67827 in vbox
- Timestamp:
- Jul 6, 2017 2:15:02 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116759
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r67693 r67827 876 876 return 0; 877 877 878 uint32_t cbWritable = 0;878 uint32_t cbWritable = UINT32_MAX; 879 879 880 880 if ( (pSink->fStatus & AUDMIXSINK_STS_RUNNING) … … 897 897 const uint32_t cbWritableStream = pMixStream->pConn->pfnStreamGetWritable(pMixStream->pConn, pMixStream->pStream); 898 898 899 if (cbWritable < cbWritableStream)899 if (cbWritableStream < cbWritable) 900 900 cbWritable = cbWritableStream; 901 902 break; /** @todo For now the first stream sets the pace. */903 901 } 904 902 #endif 905 903 } 904 905 if (cbWritable == UINT32_MAX) 906 cbWritable = 0; 906 907 907 908 Log3Func(("[%s] cbWritable=%RU32\n", pSink->pszName, cbWritable)); … … 1053 1054 int AudioMixerSinkRead(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 1054 1055 { 1056 AssertPtrReturn(pSink, VERR_INVALID_POINTER); 1055 1057 RT_NOREF(enmOp); 1056 AssertPtrReturn(pSink, VERR_INVALID_POINTER);1057 1058 AssertPtrReturn(pvBuf, VERR_INVALID_POINTER); 1058 1059 AssertReturn(cbBuf, VERR_INVALID_PARAMETER); … … 1592 1593 int AudioMixerSinkWrite(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten) 1593 1594 { 1595 AssertPtrReturn(pSink, VERR_INVALID_POINTER); 1594 1596 RT_NOREF(enmOp); 1595 AssertPtrReturn(pSink, VERR_INVALID_POINTER); 1597 AssertPtrReturn(pvBuf, VERR_INVALID_POINTER); 1598 AssertReturn (cbBuf, VERR_INVALID_PARAMETER); 1596 1599 /* pcbWritten is optional. */ 1597 1598 if (!pvBuf || !cbBuf)1599 {1600 if (pcbWritten)1601 *pcbWritten = 0;1602 return VINF_SUCCESS;1603 }1604 1600 1605 1601 int rc = RTCritSectEnter(&pSink->CritSect); … … 1614 1610 Log3Func(("[%s] enmOp=%d, cbBuf=%RU32\n", pSink->pszName, enmOp, cbBuf)); 1615 1611 1616 uint32_t cbWritten = 0;1612 uint32_t cbWritten = UINT32_MAX; 1617 1613 1618 1614 PAUDMIXSTREAM pMixStream; … … 1630 1626 LogFunc(("[%s] Failed writing to stream '%s': %Rrc\n", pSink->pszName, pMixStream->pszName, rc2)); 1631 1627 1632 if (cbProcessed < cbBuf) 1633 LogFunc(("[%s] Only written %RU32/%RU32 bytes for stream '%s', rc=%Rrc\n", 1634 pSink->pszName, cbProcessed, cbBuf, pMixStream->pszName, rc2)); 1628 Log3Func(("[%s] Written %RU32 to '%s'\n", pSink->pszName, cbProcessed, pMixStream->pszName)); 1635 1629 1636 1630 if (cbProcessed) … … 1638 1632 /* Set dirty bit. */ 1639 1633 pSink->fStatus |= AUDMIXSINK_STS_DIRTY; 1640 } 1641 1642 Log3Func(("\t%s: cbProcessed=%RU32\n", pMixStream->pszName, cbProcessed)); 1643 1644 /* 1645 * Return the maximum bytes processed by all connected streams. 1646 * Streams which have processed less than the current maximum have to deal with 1647 * this themselves. 1648 */ 1649 cbWritten = RT_MAX(cbWritten, cbProcessed); 1650 } 1634 1635 /* 1636 * Return the minimum bytes processed by all connected streams. 1637 * The host sets the pace, so all backends have to behave accordingly. 1638 */ 1639 if (cbWritten > cbProcessed) 1640 cbWritten = cbProcessed; 1641 } 1642 } 1643 1644 if (cbWritten == UINT32_MAX) 1645 cbWritten = 0; 1646 1647 Log3Func(("[%s] cbWritten=%RU32\n", pSink->pszName, cbWritten)); 1651 1648 1652 1649 if (pcbWritten)
Note:
See TracChangeset
for help on using the changeset viewer.