Changeset 56644 in vbox
- Timestamp:
- Jun 25, 2015 8:35:23 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r56622 r56644 825 825 } 826 826 827 /* 828 * Check how much we can read from the capture device without overflowing 829 * the mixer buffer. 830 */ 827 831 Assert(cAvail); 828 size_t cbToRead = AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cAvail); 832 size_t cbToRead = RT_MIN(AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cAvail), 833 AudioMixBufFreeBytes(&pHstStrmIn->MixBuf)); 829 834 830 835 LogFlowFunc(("cbToRead=%zu, cAvail=%RI32\n", cbToRead, cAvail)); … … 886 891 break; 887 892 893 /* 894 * We should not run into a full mixer buffer or we loose samples and 895 * run into an endless loop if ALSA keeps producing samples ("null" 896 * capture device for example). 897 */ 898 AssertLogRelMsgBreakStmt(cWritten > 0, ("Mixer buffer shouldn't be full at this point!\n"), 899 rc = VERR_INTERNAL_ERROR); 888 900 uint32_t cbWritten = AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cWritten); 889 901
Note:
See TracChangeset
for help on using the changeset viewer.