- Timestamp:
- Sep 7, 2016 1:54:47 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r63711 r63749 1686 1686 | PDMAUDIOSTRMSTS_FLAG_ENABLED; 1687 1687 1688 snd_pcm_t *phPCM = NULL; 1689 snd_pcm_sframes_t cSamplesMin; 1690 1691 /** @todo Get rid of this once we have a unified ALSA stream. */ 1688 1692 if (pStream->enmDir == PDMAUDIODIR_IN) 1689 1693 { 1690 1694 PALSAAUDIOSTREAMIN pStreamIn = (PALSAAUDIOSTREAMIN)pStream; 1695 phPCM = pStreamIn->phPCM; 1696 cSamplesMin = 0; 1697 } 1698 else if (pStream->enmDir == PDMAUDIODIR_OUT) 1699 { 1700 PALSAAUDIOSTREAMOUT pStreamOut = (PALSAAUDIOSTREAMOUT)pStream; 1701 phPCM = pStreamOut->phPCM; 1702 cSamplesMin = pStreamOut->cSamplesMin; 1691 1703 } 1692 1704 else 1693 { 1694 PALSAAUDIOSTREAMOUT pStreamOut = (PALSAAUDIOSTREAMOUT)pStream; 1695 1696 snd_pcm_sframes_t cAvail; 1697 int rc2 = alsaStreamGetAvail(pStreamOut->phPCM, &cAvail); 1705 AssertFailed(); 1706 1707 if (phPCM) 1708 { 1709 snd_pcm_sframes_t cSamplesAvail; 1710 int rc2 = alsaStreamGetAvail(phPCM, &cSamplesAvail); 1698 1711 if (RT_SUCCESS(rc2)) 1699 1712 { 1700 LogFlowFunc(("cAvail=%ld\n", cAvail)); 1701 if (cAvail >= (snd_pcm_sframes_t)pStreamOut->cSamplesMin) 1702 strmSts |= PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE; 1713 Log3Func(("cAvail=%ld \n", cSamplesAvail)); 1714 if (cSamplesAvail >= cSamplesMin) 1715 strmSts |= pStream->enmDir == PDMAUDIODIR_IN 1716 ? PDMAUDIOSTRMSTS_FLAG_DATA_READABLE 1717 : PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE; 1703 1718 } 1704 1719 }
Note:
See TracChangeset
for help on using the changeset viewer.