osx_output: always pass OS X result code to g_set_error().
Should be safe on OS X 10.4 (32-bit), since Apple's OSStatus boils down to "signed long", and g_set_error() takes gint, which is really just "int". Assigning "signed long" to "int" on 32-bit Unix should be just fine, since both are signed 32-bit ints. No idea if this is safe on 64-bit OS X.
This commit is contained in:
parent
80dc602193
commit
9cb4aaf3c2
@ -199,7 +199,7 @@ osx_output_set_device(struct osx_output *oo, GError **error)
|
|||||||
&size,
|
&size,
|
||||||
NULL);
|
NULL);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to determine number of OS X audio devices: %s",
|
"Unable to determine number of OS X audio devices: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
ret = false;
|
ret = false;
|
||||||
@ -213,7 +213,7 @@ osx_output_set_device(struct osx_output *oo, GError **error)
|
|||||||
&size,
|
&size,
|
||||||
deviceids);
|
deviceids);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to determine OS X audio device IDs: %s",
|
"Unable to determine OS X audio device IDs: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
ret = false;
|
ret = false;
|
||||||
@ -227,7 +227,7 @@ osx_output_set_device(struct osx_output *oo, GError **error)
|
|||||||
kAudioDevicePropertyDeviceName,
|
kAudioDevicePropertyDeviceName,
|
||||||
&size, name);
|
&size, name);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to determine OS X device name "
|
"Unable to determine OS X device name "
|
||||||
"(device %u): %s",
|
"(device %u): %s",
|
||||||
(unsigned int) deviceids[i],
|
(unsigned int) deviceids[i],
|
||||||
@ -255,7 +255,7 @@ osx_output_set_device(struct osx_output *oo, GError **error)
|
|||||||
&(deviceids[i]),
|
&(deviceids[i]),
|
||||||
sizeof(AudioDeviceID));
|
sizeof(AudioDeviceID));
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to set OS X audio output device: %s",
|
"Unable to set OS X audio output device: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
ret = false;
|
ret = false;
|
||||||
@ -296,7 +296,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error)
|
|||||||
|
|
||||||
status = OpenAComponent(comp, &od->au);
|
status = OpenAComponent(comp, &od->au);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to open OS X component: %s",
|
"Unable to open OS X component: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
return false;
|
return false;
|
||||||
@ -305,7 +305,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error)
|
|||||||
status = AudioUnitInitialize(od->au);
|
status = AudioUnitInitialize(od->au);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
CloseComponent(od->au);
|
CloseComponent(od->au);
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"Unable to initialize OS X audio unit: %s",
|
"Unable to initialize OS X audio unit: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
return false;
|
return false;
|
||||||
@ -324,7 +324,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error)
|
|||||||
if (result != noErr) {
|
if (result != noErr) {
|
||||||
AudioUnitUninitialize(od->au);
|
AudioUnitUninitialize(od->au);
|
||||||
CloseComponent(od->au);
|
CloseComponent(od->au);
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), result,
|
||||||
"unable to set callback for OS X audio unit");
|
"unable to set callback for OS X audio unit");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -364,7 +364,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error)
|
|||||||
if (result != noErr) {
|
if (result != noErr) {
|
||||||
AudioUnitUninitialize(od->au);
|
AudioUnitUninitialize(od->au);
|
||||||
CloseComponent(od->au);
|
CloseComponent(od->au);
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), result,
|
||||||
"Unable to set format on OS X device");
|
"Unable to set format on OS X device");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -379,7 +379,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error)
|
|||||||
|
|
||||||
status = AudioOutputUnitStart(od->au);
|
status = AudioOutputUnitStart(od->au);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
g_set_error(error, osx_output_quark(), 0,
|
g_set_error(error, osx_output_quark(), status,
|
||||||
"unable to start audio output: %s",
|
"unable to start audio output: %s",
|
||||||
GetMacOSStatusCommentString(status));
|
GetMacOSStatusCommentString(status));
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user