From 212290baf0dfc86a32891e07e216bb1ed6683cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Brzezi=C5=84ski?= Date: Fri, 8 Nov 2024 12:02:23 +0100 Subject: [PATCH] osxaudiosrc: Fix render callback removal when pausing/stopping At least on iOS, the 'input' callback kept being called after going to PAUSED. Specifying the right type (like in gst_core_audio_io_proc_start()) fixes that. Part-of: --- .../gst-plugins-good/sys/osxaudio/gstosxcoreaudiocommon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/sys/osxaudio/gstosxcoreaudiocommon.c b/subprojects/gst-plugins-good/sys/osxaudio/gstosxcoreaudiocommon.c index d520e514ef..8a0f7e0cfe 100644 --- a/subprojects/gst-plugins-good/sys/osxaudio/gstosxcoreaudiocommon.c +++ b/subprojects/gst-plugins-good/sys/osxaudio/gstosxcoreaudiocommon.c @@ -31,14 +31,18 @@ gst_core_audio_remove_render_callback (GstCoreAudio * core_audio) { AURenderCallbackStruct input; OSStatus status; + AudioUnitPropertyID callback_type; /* Deactivate the render callback by calling SetRenderCallback * with a NULL inputProc. */ input.inputProc = NULL; input.inputProcRefCon = NULL; + callback_type = core_audio->is_src ? + kAudioOutputUnitProperty_SetInputCallback : + kAudioUnitProperty_SetRenderCallback; - status = AudioUnitSetProperty (core_audio->audiounit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, /* N/A for global */ + status = AudioUnitSetProperty (core_audio->audiounit, callback_type, kAudioUnitScope_Global, 0, /* N/A for global */ &input, sizeof (input)); if (status) {