Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider probe_error not a fatal error #30

Merged
merged 1 commit into from May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions pysoundio/_soundiox.c
Expand Up @@ -596,10 +596,6 @@ pysoundio__get_input_device(PyObject *self, PyObject *args)
return NULL;

rc.input_device = soundio_get_input_device(rc.soundio, device_index);
if (rc.input_device->probe_error) {
PyErr_SetString(PySoundIoError, "Unable to probe device\n");
return NULL;
}

return PyLong_FromVoidPtr(rc.input_device);
}
Expand All @@ -613,10 +609,6 @@ pysoundio__get_output_device(PyObject *self, PyObject *args)
return NULL;

rc.output_device = soundio_get_output_device(rc.soundio, device_index);
if (rc.output_device->probe_error) {
PyErr_SetString(PySoundIoError, "Unable to probe device\n");
return NULL;
}

return PyLong_FromVoidPtr(rc.output_device);
}
Expand Down
6 changes: 4 additions & 2 deletions pysoundio/pysoundio.py
Expand Up @@ -251,7 +251,8 @@ def list_devices(self):
'layouts': self.get_layouts(device),
'software_latency_min': pydevice.contents.software_latency_min,
'software_latency_max': pydevice.contents.software_latency_max,
'software_latency_current': pydevice.contents.software_latency_current
'software_latency_current': pydevice.contents.software_latency_current,
'probe_error': PySoundIoError(soundio.strerror(pydevice.contents.probe_error)) if pydevice.contents.probe_error else None
})
soundio.device_unref(device)

Expand All @@ -266,7 +267,8 @@ def list_devices(self):
'layouts': self.get_layouts(device),
'software_latency_min': pydevice.contents.software_latency_min,
'software_latency_max': pydevice.contents.software_latency_max,
'software_latency_current': pydevice.contents.software_latency_current
'software_latency_current': pydevice.contents.software_latency_current,
'probe_error': PySoundIoError(soundio.strerror(pydevice.contents.probe_error)) if pydevice.contents.probe_error else None
})
soundio.device_unref(device)

Expand Down