diff options
author | Greg Ward <greg@gerg.ca> | 2010-12-20 22:21:47 -0500 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-12-21 07:37:54 +0100 |
commit | 9cb4aaf3c2f530dcb7927f9b9a61d4d26c974fa2 (patch) | |
tree | c3a86991f37f4f202c11faeea6a28e931e83285e /src/output | |
parent | 80dc6021931e12cb465a46f7b61e7aef19012080 (diff) | |
download | mpd-9cb4aaf3c2f530dcb7927f9b9a61d4d26c974fa2.tar.gz mpd-9cb4aaf3c2f530dcb7927f9b9a61d4d26c974fa2.tar.xz mpd-9cb4aaf3c2f530dcb7927f9b9a61d4d26c974fa2.zip |
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.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/osx_plugin.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index db9dbdf8a..9c3c2b1ba 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -199,7 +199,7 @@ osx_output_set_device(struct osx_output *oo, GError **error) &size, NULL); 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", GetMacOSStatusCommentString(status)); ret = false; @@ -213,7 +213,7 @@ osx_output_set_device(struct osx_output *oo, GError **error) &size, deviceids); 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", GetMacOSStatusCommentString(status)); ret = false; @@ -227,7 +227,7 @@ osx_output_set_device(struct osx_output *oo, GError **error) kAudioDevicePropertyDeviceName, &size, name); 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 " "(device %u): %s", (unsigned int) deviceids[i], @@ -255,7 +255,7 @@ osx_output_set_device(struct osx_output *oo, GError **error) &(deviceids[i]), sizeof(AudioDeviceID)); 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", GetMacOSStatusCommentString(status)); ret = false; @@ -296,7 +296,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error) status = OpenAComponent(comp, &od->au); 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", GetMacOSStatusCommentString(status)); return false; @@ -305,7 +305,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error) status = AudioUnitInitialize(od->au); if (status != noErr) { 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", GetMacOSStatusCommentString(status)); return false; @@ -324,7 +324,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error) if (result != noErr) { AudioUnitUninitialize(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"); return false; } @@ -364,7 +364,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error) if (result != noErr) { AudioUnitUninitialize(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"); return false; } @@ -379,7 +379,7 @@ osx_output_open(void *data, struct audio_format *audio_format, GError **error) status = AudioOutputUnitStart(od->au); 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", GetMacOSStatusCommentString(status)); return false; |