mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-22 00:35:48 +01:00
fix last bug 11 commit to use dummy callback as passing in NULL opens stream in blocking mode which fails often
This commit is contained in:
@@ -84,6 +84,18 @@ static wxString MakeDeviceSourceString(DeviceSourceMap *map)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Port Audio requires we open the stream with a callback or a lot of devices will fail
|
||||||
|
//as this means open in blocking mode, so we use a dummy one.
|
||||||
|
static int DummyPaStreamCallback(
|
||||||
|
const void *input, void *output,
|
||||||
|
unsigned long frameCount,
|
||||||
|
const PaStreamCallbackTimeInfo* timeInfo,
|
||||||
|
PaStreamCallbackFlags statusFlags,
|
||||||
|
void *userData )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void AddSourcesFromStream(int deviceIndex, wxString &devName, wxArrayString *descs, std::vector<DeviceSourceMap> *maps, PaStream *stream)
|
static void AddSourcesFromStream(int deviceIndex, wxString &devName, wxArrayString *descs, std::vector<DeviceSourceMap> *maps, PaStream *stream)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -155,7 +167,7 @@ static void AddSources(int deviceIndex, int rate, wxArrayString *descs, std::vec
|
|||||||
isInput ? NULL : ¶meters,
|
isInput ? NULL : ¶meters,
|
||||||
rate, paFramesPerBufferUnspecified,
|
rate, paFramesPerBufferUnspecified,
|
||||||
paClipOff | paDitherOff,
|
paClipOff | paDitherOff,
|
||||||
NULL, NULL);
|
DummyPaStreamCallback, NULL);
|
||||||
if (stream) {
|
if (stream) {
|
||||||
AddSourcesFromStream(deviceIndex, devName, descs, maps, stream);
|
AddSourcesFromStream(deviceIndex, devName, descs, maps, stream);
|
||||||
Pa_CloseStream(stream);
|
Pa_CloseStream(stream);
|
||||||
|
|||||||
Reference in New Issue
Block a user