Changeset 61320 in vbox for trunk/src/VBox/Devices/Audio/AudioMixer.cpp
- Timestamp:
- May 31, 2016 8:43:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r61178 r61320 405 405 } 406 406 407 RTStrPrintf(CfgSink.szName, sizeof(CfgSink.szName), "%s", pCfg->szName); 408 407 409 /* Always use the sink's PCM audio format as the host side when creating a stream for it. */ 408 410 PPDMAUDIOSTREAM pStream; … … 583 585 /** @todo Handle mixing operation enmOp! */ 584 586 587 AssertMsg(pSink->enmDir == AUDMIXSINKDIR_INPUT, 588 ("Can't read from a sink which is not an input sink\n")); 589 585 590 uint8_t *pvMixBuf = (uint8_t *)RTMemAlloc(cbBuf); 586 591 if (!pvMixBuf) … … 797 802 int rc = VINF_SUCCESS; 798 803 804 Log3Func(("[%s]\n", pSink->pszName)); 805 799 806 PAUDMIXSTREAM pMixStream; 800 807 RTListForEach(&pSink->lstStreams, pMixStream, AUDMIXSTREAM, Node) … … 803 810 AssertPtr(pStream); 804 811 805 uint32_t cSamplesAvail; 806 uint32_t cSamplesProcessed = 0; 807 808 rc = pMixStream->pConn->pfnStreamGetData(pMixStream->pConn, pStream, &cSamplesAvail); 809 if ( RT_SUCCESS(rc) 810 && cSamplesAvail) 812 uint32_t cPlayed = 0; 813 814 rc = pMixStream->pConn->pfnStreamIterate(pMixStream->pConn, pStream); 815 if (RT_SUCCESS(rc)) 811 816 { 812 817 if (pStream->enmDir == PDMAUDIODIR_IN) 813 818 { 814 819 /** @todo Implement this! */ 815 // rc = pStream->pConn->pfnCapture(pStream->pConn, NULL /* pcSamplesCaptured */); 820 #if 0 821 rc = pStream->pConn->pfnStreamCapture(pStream->pConn, NULL /* pcSamplesCaptured */); 822 #endif 816 823 } 817 824 else 818 825 { 819 rc = pMixStream->pConn->pfnStreamPlay(pMixStream->pConn, pStream, &cSamplesProcessed); 826 rc = pMixStream->pConn->pfnStreamPlay(pMixStream->pConn, pMixStream->pStream, &cPlayed); 827 if (RT_FAILURE(rc)) 828 LogFlowFunc(("%s: Failed playing stream '%s': %Rrc\n", pSink->pszName, pMixStream->pStream->szName, rc)); 820 829 } 821 822 pSink->fFlags |= AUDMIXSINK_FLAG_DIRTY;823 830 } 824 else if (!cSamplesAvail) 825 pSink->fFlags &= ~AUDMIXSINK_FLAG_DIRTY; 826 827 Log3Func(("[%s]: fFlags=0x%x, %RU32/%RU32 samples, rc=%Rrc\n", 828 pSink->pszName, pSink->fFlags, cSamplesProcessed, cSamplesAvail, rc)); 831 832 Log3Func(("\t%s: cPlayed=%RU32, rc=%Rrc\n", pMixStream->pStream->szName, cPlayed, rc)); 829 833 } 830 834 … … 884 888 } 885 889 886 uint32_t cbProcessed = 0; 890 AssertMsg(pSink->enmDir == AUDMIXSINKDIR_OUTPUT, 891 ("Can't write to a sink which is not an output sink\n")); 892 893 LogFlowFunc(("%s: enmOp=%ld, cbBuf=%RU32\n", pSink->pszName, enmOp, cbBuf)); 894 895 uint32_t cPlayed; 896 uint32_t cbProcessed; 887 897 888 898 PAUDMIXSTREAM pMixStream; … … 893 903 894 904 int rc2 = pMixStream->pConn->pfnStreamWrite(pMixStream->pConn, pMixStream->pStream, pvBuf, cbBuf, &cbProcessed); 895 if ( RT_FAILURE(rc2) 896 || cbProcessed < cbBuf) 897 { 898 LogFlowFunc(("rc=%Rrc, cbBuf=%RU32, cbProcessed=%RU32\n", rc2, cbBuf, cbProcessed)); 899 } 900 } 905 if (RT_FAILURE(rc2)) 906 LogFlowFunc(("%s: Failed writing to stream '%s': %Rrc\n", pSink->pszName, pMixStream->pStream->szName, rc2)); 907 908 if (cbProcessed < cbBuf) 909 LogFlowFunc(("%s: Only written %RU32/%RU32 bytes\n", pSink->pszName, pMixStream->pStream->szName, cbProcessed, cbBuf)); 910 } 911 912 /* Set dirty bit. */ 913 pSink->fFlags |= AUDMIXSINK_FLAG_DIRTY; 901 914 902 915 if (pcbWritten)
Note:
See TracChangeset
for help on using the changeset viewer.