blob: 7c484bb9d3b699c97e9650d55eb5bfd6687a2dd2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
--- src/VBox/Devices/Audio/DrvHostOSSAudio.cpp.orig 2021-01-07 15:37:12 UTC
+++ src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
@@ -253,10 +253,11 @@ static int ossStreamOpen(const char *pszDev, int fOpen
default:
rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE;
+ iFormat = -1;
break;
}
- if (RT_FAILURE(rc))
+ if (RT_UNLIKELY(iFormat == -1))
break;
if (ioctl(fdFile, SNDCTL_DSP_SAMPLESIZE, &iFormat))
@@ -664,6 +665,7 @@ static int ossCreateStreamIn(POSSAUDIOSTREAM pStreamOS
pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, ossAcq.cbFragmentSize);
pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering". */
+ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize;
/** @todo Pre-buffering required? */
}
}
@@ -782,6 +784,7 @@ static int ossCreateStreamOut(POSSAUDIOSTREAM pStreamO
#endif
pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, obtStream.cbFragmentSize);
pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering" */
+ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize;
}
} while (0);
|