mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
osxaudio: Bind audio device to audio unit early
We want to bind the device during open so that subsequent format queries on the audio unit are as specific as possible from that point onwards. https://bugzilla.gnome.org/show_bug.cgi?id=740987
This commit is contained in:
parent
2d0391c6e1
commit
48872dbc56
1 changed files with 16 additions and 4 deletions
|
@ -1007,6 +1007,8 @@ _io_proc_spdif_stop (GstCoreAudio * core_audio)
|
|||
static gboolean
|
||||
gst_core_audio_open_impl (GstCoreAudio * core_audio)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
/* The following is needed to instruct HAL to create their own
|
||||
* thread to handle the notifications. */
|
||||
_audio_system_set_runloop (NULL);
|
||||
|
@ -1021,8 +1023,21 @@ gst_core_audio_open_impl (GstCoreAudio * core_audio)
|
|||
* we will do input with it.
|
||||
* http://developer.apple.com/technotes/tn2002/tn2091.html
|
||||
*/
|
||||
return gst_core_audio_open_device (core_audio, kAudioUnitSubType_HALOutput,
|
||||
ret = gst_core_audio_open_device (core_audio, kAudioUnitSubType_HALOutput,
|
||||
"HALOutput");
|
||||
if (!ret) {
|
||||
GST_DEBUG ("Could not open device");
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = gst_core_audio_bind_device (core_audio);
|
||||
if (!ret) {
|
||||
GST_DEBUG ("Could not bind device");
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1124,9 +1139,6 @@ gst_core_audio_initialize_impl (GstCoreAudio * core_audio,
|
|||
format.mChannelsPerFrame, caps))
|
||||
goto done;
|
||||
|
||||
if (!gst_core_audio_bind_device (core_audio))
|
||||
goto done;
|
||||
|
||||
if (core_audio->is_src) {
|
||||
propertySize = sizeof (*frame_size);
|
||||
status = AudioUnitGetProperty (core_audio->audiounit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0, /* N/A for global */
|
||||
|
|
Loading…
Reference in a new issue