osxaudio: OSStatus is not a fourcc, so don't print it as one...

This commit is contained in:
Sebastian Dröge 2014-09-17 13:55:18 +03:00
parent 7cd335e9b9
commit d8a4435fd8
4 changed files with 57 additions and 94 deletions

View file

@ -101,8 +101,7 @@ gst_core_audio_open (GstCoreAudio * core_audio)
AudioComponentInstanceDispose (core_audio->audiounit); AudioComponentInstanceDispose (core_audio->audiounit);
core_audio->audiounit = NULL; core_audio->audiounit = NULL;
GST_WARNING_OBJECT (core_audio, GST_WARNING_OBJECT (core_audio,
"Unable to obtain device properties: %" GST_FOURCC_FORMAT, "Unable to obtain device properties: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} else { } else {
src->deviceChannels = asbd_in.mChannelsPerFrame; src->deviceChannels = asbd_in.mChannelsPerFrame;
@ -164,8 +163,8 @@ gst_core_audio_initialize (GstCoreAudio * core_audio,
/* Initialize the AudioUnit */ /* Initialize the AudioUnit */
status = AudioUnitInitialize (core_audio->audiounit); status = AudioUnitInitialize (core_audio->audiounit);
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio, "Failed to initialise AudioUnit: %" GST_ERROR_OBJECT (core_audio, "Failed to initialise AudioUnit: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
goto error; goto error;
} }
return TRUE; return TRUE;

View file

@ -39,8 +39,8 @@ gst_core_audio_remove_render_callback (GstCoreAudio * core_audio)
&input, sizeof (input)); &input, sizeof (input));
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to remove render callback %" GST_WARNING_OBJECT (core_audio->osxbuf,
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); "Failed to remove render callback %d", (int) status);
} }
/* Remove the RenderNotify too */ /* Remove the RenderNotify too */
@ -49,8 +49,7 @@ gst_core_audio_remove_render_callback (GstCoreAudio * core_audio)
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, GST_WARNING_OBJECT (core_audio->osxbuf,
"Failed to remove render notify callback %" GST_FOURCC_FORMAT, "Failed to remove render notify callback %d", (int) status);
GST_FOURCC_ARGS (status));
} }
/* We're deactivated.. */ /* We're deactivated.. */
@ -103,8 +102,7 @@ gst_core_audio_io_proc_start (GstCoreAudio * core_audio)
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioUnitSetProperty failed: %" GST_FOURCC_FORMAT, "AudioUnitSetProperty failed: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
// ### does it make sense to do this notify stuff for input mode? // ### does it make sense to do this notify stuff for input mode?
@ -113,8 +111,7 @@ gst_core_audio_io_proc_start (GstCoreAudio * core_audio)
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioUnitAddRenderNotify failed %" "AudioUnitAddRenderNotify failed %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
core_audio->io_proc_active = TRUE; core_audio->io_proc_active = TRUE;
@ -124,8 +121,8 @@ gst_core_audio_io_proc_start (GstCoreAudio * core_audio)
status = AudioOutputUnitStart (core_audio->audiounit); status = AudioOutputUnitStart (core_audio->audiounit);
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio->osxbuf, "AudioOutputUnitStart failed: %" GST_ERROR_OBJECT (core_audio->osxbuf, "AudioOutputUnitStart failed: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@ -143,8 +140,7 @@ gst_core_audio_io_proc_stop (GstCoreAudio * core_audio)
status = AudioOutputUnitStop (core_audio->audiounit); status = AudioOutputUnitStop (core_audio->audiounit);
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, GST_WARNING_OBJECT (core_audio->osxbuf,
"AudioOutputUnitStop failed: %" GST_FOURCC_FORMAT, "AudioOutputUnitStop failed: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
// ###: why is it okay to directly remove from here but not from pause() ? // ###: why is it okay to directly remove from here but not from pause() ?
if (core_audio->io_proc_active) { if (core_audio->io_proc_active) {
@ -198,8 +194,8 @@ gst_core_audio_bind_device (GstCoreAudio * core_audio)
kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0,
&core_audio->device_id, sizeof (AudioDeviceID)); &core_audio->device_id, sizeof (AudioDeviceID));
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio->osxbuf, "Failed binding to device: %" GST_ERROR_OBJECT (core_audio->osxbuf, "Failed binding to device: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
goto audiounit_error; goto audiounit_error;
} }
return TRUE; return TRUE;
@ -272,8 +268,7 @@ gst_core_audio_set_channels_layout (GstCoreAudio * core_audio,
scope, element, layout, layoutSize); scope, element, layout, layoutSize);
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, GST_WARNING_OBJECT (core_audio->osxbuf,
"Failed to set output channel layout: %" GST_FOURCC_FORMAT, "Failed to set output channel layout: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
} }
@ -303,8 +298,7 @@ gst_core_audio_set_format (GstCoreAudio * core_audio,
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, GST_WARNING_OBJECT (core_audio->osxbuf,
"Failed to set audio description: %" GST_FOURCC_FORMAT, "Failed to set audio description: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE;; return FALSE;;
} }
@ -338,8 +332,8 @@ gst_core_audio_open_device (GstCoreAudio * core_audio, OSType sub_type,
status = AudioComponentInstanceNew (comp, &unit); status = AudioComponentInstanceNew (comp, &unit);
if (status) { if (status) {
GST_ERROR_OBJECT (core_audio->osxbuf, "Couldn't open %s component %" GST_ERROR_OBJECT (core_audio->osxbuf, "Couldn't open %s component %d",
GST_FOURCC_FORMAT, adesc, GST_FOURCC_ARGS (status)); adesc, (int) status);
return FALSE; return FALSE;
} }
@ -351,8 +345,8 @@ gst_core_audio_open_device (GstCoreAudio * core_audio, OSType sub_type,
if (status) { if (status) {
AudioComponentInstanceDispose (unit); AudioComponentInstanceDispose (unit);
GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to enable input: %" GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to enable input: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
return FALSE; return FALSE;
} }
@ -363,8 +357,8 @@ gst_core_audio_open_device (GstCoreAudio * core_audio, OSType sub_type,
if (status) { if (status) {
AudioComponentInstanceDispose (unit); AudioComponentInstanceDispose (unit);
GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to disable output: %" GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to disable output: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
return FALSE; return FALSE;
} }
} }

View file

@ -42,8 +42,7 @@ _audio_system_set_runloop (CFRunLoopRef runLoop)
if (status == noErr) { if (status == noErr) {
res = TRUE; res = TRUE;
} else { } else {
GST_ERROR ("failed to set runloop to %p: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to set runloop to %p: %d", runLoop, (int) status);
runLoop, GST_FOURCC_ARGS (status));
} }
return res; return res;
@ -65,8 +64,7 @@ _audio_system_get_default_output (void)
status = AudioObjectGetPropertyData (kAudioObjectSystemObject, status = AudioObjectGetPropertyData (kAudioObjectSystemObject,
&defaultDeviceAddress, 0, NULL, &propertySize, &device_id); &defaultDeviceAddress, 0, NULL, &propertySize, &device_id);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed getting default output device: %" GST_ERROR ("failed getting default output device: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
} }
return device_id; return device_id;
@ -88,8 +86,7 @@ _audio_system_get_devices (gint * ndevices)
status = AudioObjectGetPropertyDataSize (kAudioObjectSystemObject, status = AudioObjectGetPropertyDataSize (kAudioObjectSystemObject,
&audioDevicesAddress, 0, NULL, &propertySize); &audioDevicesAddress, 0, NULL, &propertySize);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting number of devices: %" GST_WARNING ("failed getting number of devices: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
return NULL; return NULL;
} }
@ -100,8 +97,7 @@ _audio_system_get_devices (gint * ndevices)
status = AudioObjectGetPropertyData (kAudioObjectSystemObject, status = AudioObjectGetPropertyData (kAudioObjectSystemObject,
&audioDevicesAddress, 0, NULL, &propertySize, devices); &audioDevicesAddress, 0, NULL, &propertySize, devices);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting the list of devices: %" GST_WARNING ("failed getting the list of devices: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
g_free (devices); g_free (devices);
*ndevices = 0; *ndevices = 0;
return NULL; return NULL;
@ -148,8 +144,7 @@ _audio_device_get_latency (AudioDeviceID device_id)
status = AudioObjectGetPropertyData (device_id, status = AudioObjectGetPropertyData (device_id,
&audioDeviceLatencyAddress, 0, NULL, &propertySize, &latency); &audioDeviceLatencyAddress, 0, NULL, &propertySize, &latency);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get latency: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get latency: %d", (int) status);
GST_FOURCC_ARGS (status));
latency = -1; latency = -1;
} }
@ -172,8 +167,7 @@ _audio_device_get_hog (AudioDeviceID device_id)
status = AudioObjectGetPropertyData (device_id, status = AudioObjectGetPropertyData (device_id,
&audioDeviceHogModeAddress, 0, NULL, &propertySize, &hog_pid); &audioDeviceHogModeAddress, 0, NULL, &propertySize, &hog_pid);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get hog: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get hog: %d", (int) status);
GST_FOURCC_ARGS (status));
hog_pid = -1; hog_pid = -1;
} }
@ -199,8 +193,7 @@ _audio_device_set_hog (AudioDeviceID device_id, pid_t hog_pid)
if (status == noErr) { if (status == noErr) {
res = TRUE; res = TRUE;
} else { } else {
GST_ERROR ("failed to set hog: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to set hog: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
return res; return res;
@ -225,20 +218,17 @@ _audio_device_set_mixing (AudioDeviceID device_id, gboolean enable_mix)
status = AudioObjectIsPropertySettable (device_id, status = AudioObjectIsPropertySettable (device_id,
&audioDeviceSupportsMixingAddress, &writable); &audioDeviceSupportsMixingAddress, &writable);
if (status) { if (status) {
GST_DEBUG ("AudioObjectIsPropertySettable: %" GST_FOURCC_FORMAT, GST_DEBUG ("AudioObjectIsPropertySettable: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
status = AudioObjectGetPropertyDataSize (device_id, status = AudioObjectGetPropertyDataSize (device_id,
&audioDeviceSupportsMixingAddress, 0, NULL, &propertySize); &audioDeviceSupportsMixingAddress, 0, NULL, &propertySize);
if (status) { if (status) {
GST_DEBUG ("AudioObjectGetPropertyDataSize: %" GST_FOURCC_FORMAT, GST_DEBUG ("AudioObjectGetPropertyDataSize: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
status = AudioObjectGetPropertyData (device_id, status = AudioObjectGetPropertyData (device_id,
&audioDeviceSupportsMixingAddress, 0, NULL, &propertySize, &can_mix); &audioDeviceSupportsMixingAddress, 0, NULL, &propertySize, &can_mix);
if (status) { if (status) {
GST_DEBUG ("AudioObjectGetPropertyData: %" GST_FOURCC_FORMAT, GST_DEBUG ("AudioObjectGetPropertyData: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
if (status == noErr && writable) { if (status == noErr && writable) {
@ -249,8 +239,7 @@ _audio_device_set_mixing (AudioDeviceID device_id, gboolean enable_mix)
} }
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to set mixmode: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to set mixmode: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
} else { } else {
GST_DEBUG ("property not found, mixing coudln't be changed"); GST_DEBUG ("property not found, mixing coudln't be changed");
@ -333,8 +322,7 @@ gst_core_audio_audio_device_get_channel_layout (AudioDeviceID device_id)
status = AudioObjectGetPropertyDataSize (device_id, status = AudioObjectGetPropertyDataSize (device_id,
&channelLayoutAddress, 0, NULL, &propertySize); &channelLayoutAddress, 0, NULL, &propertySize);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get prefered layout: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get prefered layout: %d", (int) status);
GST_FOURCC_ARGS (status));
goto beach; goto beach;
} }
@ -343,8 +331,7 @@ gst_core_audio_audio_device_get_channel_layout (AudioDeviceID device_id)
status = AudioObjectGetPropertyData (device_id, status = AudioObjectGetPropertyData (device_id,
&channelLayoutAddress, 0, NULL, &propertySize, layout); &channelLayoutAddress, 0, NULL, &propertySize, layout);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get prefered layout: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get prefered layout: %d", (int) status);
GST_FOURCC_ARGS (status));
goto failed; goto failed;
} }
@ -354,8 +341,7 @@ gst_core_audio_audio_device_get_channel_layout (AudioDeviceID device_id)
AudioFormatGetProperty (kAudioFormatProperty_ChannelLayoutForBitmap, AudioFormatGetProperty (kAudioFormatProperty_ChannelLayoutForBitmap,
sizeof (UInt32), &layout->mChannelBitmap, &propertySize, layout); sizeof (UInt32), &layout->mChannelBitmap, &propertySize, layout);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get layout for bitmap: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get layout for bitmap: %d", (int) status);
GST_FOURCC_ARGS (status));
goto failed; goto failed;
} }
} else if (layout->mChannelLayoutTag != } else if (layout->mChannelLayoutTag !=
@ -365,8 +351,7 @@ gst_core_audio_audio_device_get_channel_layout (AudioDeviceID device_id)
sizeof (AudioChannelLayoutTag), &layout->mChannelLayoutTag, sizeof (AudioChannelLayoutTag), &layout->mChannelLayoutTag,
&propertySize, layout); &propertySize, layout);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get layout for tag: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get layout for tag: %d", (int) status);
GST_FOURCC_ARGS (status));
goto failed; goto failed;
} }
} }
@ -397,8 +382,7 @@ _audio_device_get_streams (AudioDeviceID device_id, gint * nstreams)
status = AudioObjectGetPropertyDataSize (device_id, status = AudioObjectGetPropertyDataSize (device_id,
&streamsAddress, 0, NULL, &propertySize); &streamsAddress, 0, NULL, &propertySize);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting number of streams: %" GST_WARNING ("failed getting number of streams: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
return NULL; return NULL;
} }
@ -409,8 +393,7 @@ _audio_device_get_streams (AudioDeviceID device_id, gint * nstreams)
status = AudioObjectGetPropertyData (device_id, status = AudioObjectGetPropertyData (device_id,
&streamsAddress, 0, NULL, &propertySize, streams); &streamsAddress, 0, NULL, &propertySize, streams);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting the list of streams: %" GST_WARNING ("failed getting the list of streams: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
g_free (streams); g_free (streams);
*nstreams = 0; *nstreams = 0;
return NULL; return NULL;
@ -436,8 +419,7 @@ _audio_stream_get_latency (AudioStreamID stream_id)
status = AudioObjectGetPropertyData (stream_id, status = AudioObjectGetPropertyData (stream_id,
&latencyAddress, 0, NULL, &propertySize, &latency); &latencyAddress, 0, NULL, &propertySize, &latency);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get latency: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get latency: %d", (int) status);
GST_FOURCC_ARGS (status));
latency = -1; latency = -1;
} }
@ -460,8 +442,7 @@ _audio_stream_get_current_format (AudioStreamID stream_id,
status = AudioObjectGetPropertyData (stream_id, status = AudioObjectGetPropertyData (stream_id,
&formatAddress, 0, NULL, &propertySize, format); &formatAddress, 0, NULL, &propertySize, format);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to get current format: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to get current format: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
@ -484,8 +465,7 @@ _audio_stream_set_current_format (AudioStreamID stream_id,
status = AudioObjectSetPropertyData (stream_id, status = AudioObjectSetPropertyData (stream_id,
&formatAddress, 0, NULL, propertySize, &format); &formatAddress, 0, NULL, propertySize, &format);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("failed to set current format: %" GST_FOURCC_FORMAT, GST_ERROR ("failed to set current format: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
@ -508,8 +488,7 @@ _audio_stream_get_formats (AudioStreamID stream_id, gint * nformats)
status = AudioObjectGetPropertyDataSize (stream_id, status = AudioObjectGetPropertyDataSize (stream_id,
&formatsAddress, 0, NULL, &propertySize); &formatsAddress, 0, NULL, &propertySize);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting number of stream formats: %" GST_WARNING ("failed getting number of stream formats: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
return NULL; return NULL;
} }
@ -520,8 +499,8 @@ _audio_stream_get_formats (AudioStreamID stream_id, gint * nformats)
status = AudioObjectGetPropertyData (stream_id, status = AudioObjectGetPropertyData (stream_id,
&formatsAddress, 0, NULL, &propertySize, formats); &formatsAddress, 0, NULL, &propertySize, formats);
if (status != noErr) { if (status != noErr) {
GST_WARNING ("failed getting the list of stream formats: %" GST_WARNING ("failed getting the list of stream formats: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
g_free (formats); g_free (formats);
*nformats = 0; *nformats = 0;
return NULL; return NULL;
@ -606,8 +585,7 @@ _audio_stream_change_format (AudioStreamID stream_id,
status = AudioObjectAddPropertyListener (stream_id, &formatAddress, status = AudioObjectAddPropertyListener (stream_id, &formatAddress,
_audio_stream_format_listener, (void *) &prop_mutex); _audio_stream_format_listener, (void *) &prop_mutex);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("AudioObjectAddPropertyListener failed: %" GST_ERROR ("AudioObjectAddPropertyListener failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
goto done; goto done;
} }
@ -655,8 +633,7 @@ done:
status = AudioObjectRemovePropertyListener (stream_id, status = AudioObjectRemovePropertyListener (stream_id,
&formatAddress, _audio_stream_format_listener, (void *) &prop_mutex); &formatAddress, _audio_stream_format_listener, (void *) &prop_mutex);
if (status != noErr) { if (status != noErr) {
GST_ERROR ("AudioObjectRemovePropertyListener failed: %" GST_ERROR ("AudioObjectRemovePropertyListener failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
} }
/* Destroy the lock and condition */ /* Destroy the lock and condition */
g_mutex_unlock (&prop_mutex.lock); g_mutex_unlock (&prop_mutex.lock);
@ -708,8 +685,7 @@ _monitorize_spdif (GstCoreAudio * core_audio)
(void *) core_audio); (void *) core_audio);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioObjectAddPropertyListener failed: %" "AudioObjectAddPropertyListener failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
ret = FALSE; ret = FALSE;
} }
@ -734,8 +710,7 @@ _unmonitorize_spdif (GstCoreAudio * core_audio)
(void *) core_audio); (void *) core_audio);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioObjectRemovePropertyListener failed: %" "AudioObjectRemovePropertyListener failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
ret = FALSE; ret = FALSE;
} }
@ -933,8 +908,7 @@ _remove_render_spdif_callback (GstCoreAudio * core_audio)
AudioDeviceDestroyIOProcID (core_audio->device_id, core_audio->procID); AudioDeviceDestroyIOProcID (core_audio->device_id, core_audio->procID);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioDeviceDestroyIOProcID failed: %" "AudioDeviceDestroyIOProcID failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
} }
GST_DEBUG_OBJECT (core_audio, GST_DEBUG_OBJECT (core_audio,
@ -963,8 +937,7 @@ _io_proc_spdif_start (GstCoreAudio * core_audio)
(void *) core_audio, &core_audio->procID); (void *) core_audio, &core_audio->procID);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
":AudioDeviceCreateIOProcID failed: %" ":AudioDeviceCreateIOProcID failed: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
core_audio->io_proc_active = TRUE; core_audio->io_proc_active = TRUE;
@ -976,8 +949,7 @@ _io_proc_spdif_start (GstCoreAudio * core_audio)
status = AudioDeviceStart (core_audio->device_id, core_audio->procID); status = AudioDeviceStart (core_audio->device_id, core_audio->procID);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioDeviceStart failed: %" GST_FOURCC_FORMAT, "AudioDeviceStart failed: %d", (int) status);
GST_FOURCC_ARGS (status));
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@ -992,8 +964,7 @@ _io_proc_spdif_stop (GstCoreAudio * core_audio)
status = AudioDeviceStop (core_audio->device_id, core_audio->procID); status = AudioDeviceStop (core_audio->device_id, core_audio->procID);
if (status != noErr) { if (status != noErr) {
GST_ERROR_OBJECT (core_audio->osxbuf, GST_ERROR_OBJECT (core_audio->osxbuf,
"AudioDeviceStop failed: %" GST_FOURCC_FORMAT, "AudioDeviceStop failed: %d", (int) status);
GST_FOURCC_ARGS (status));
} }
GST_DEBUG_OBJECT (core_audio, GST_DEBUG_OBJECT (core_audio,
@ -1099,8 +1070,8 @@ gst_core_audio_get_samples_and_latency_impl (GstCoreAudio * core_audio,
latency, &size); latency, &size);
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to get latency: %" GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to get latency: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
*samples = 0; *samples = 0;
return FALSE; return FALSE;
} }
@ -1143,8 +1114,8 @@ gst_core_audio_initialize_impl (GstCoreAudio * core_audio,
frame_size, &propertySize); frame_size, &propertySize);
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to get frame size: %" GST_WARNING_OBJECT (core_audio->osxbuf, "Failed to get frame size: %d",
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status)); (int) status);
goto done; goto done;
} }
} }

View file

@ -70,8 +70,7 @@ gst_core_audio_get_samples_and_latency_impl (GstCoreAudio * core_audio,
latency, &size); latency, &size);
if (status) { if (status) {
GST_WARNING_OBJECT (core_audio, "Failed to get latency: %" GST_WARNING_OBJECT (core_audio, "Failed to get latency: %d", (int) status);
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (status));
*samples = 0; *samples = 0;
return FALSE; return FALSE;
} }