Changeset 89519 in vbox for trunk/src/VBox
- Timestamp:
- Jun 4, 2021 10:51:37 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r89518 r89519 838 838 839 839 /* 840 * HACK ALERT! Tweak to force recording to start. Pretend there are bytes 841 * available if we haven't read anything yet. This will cause 842 * the following StreamCapture call to block and make sure the 843 * stream is really recording. 840 * HACK ALERT! To force the stream to start recording, we read a frame 841 * here if we get back that there are zero bytes available 842 * and we're at the start of the stream. (We cannot just 843 * return a frame size, we have to read it, as pre-buffering 844 * would prevent it from being read.) 844 845 */ 845 846 if (BufInfo.bytes > 0 || pStreamOSS->offInternal != 0) 846 847 { /* likely */ } 847 848 else 848 cbRet = PDMAudioPropsFramesToBytes(&pStreamOSS->Cfg.Props, 1); 849 { 850 uint32_t cbToRead = PDMAudioPropsFramesToBytes(&pStreamOSS->Cfg.Props, 1); 851 uint8_t abFrame[256]; 852 Assert(cbToRead < sizeof(abFrame)); 853 ssize_t cbRead = read(pStreamOSS->hFile, abFrame, cbToRead); 854 RT_NOREF(cbRead); 855 LogFunc(("Dummy read for '%s' returns %zd (errno=%d)\n", pStreamOSS->Cfg.szName, cbRead, errno)); 856 } 849 857 850 858 Log4Func(("returns %#x (%u) [cbBuf=%#x]\n", cbRet, cbRet, cbBuf));
Note:
See TracChangeset
for help on using the changeset viewer.