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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
This commit is contained in:
Piotr Brzeziński 2024-11-08 12:02:23 +01:00 committed by GStreamer Marge Bot
parent 49489d35ae
commit 212290baf0

View file

@ -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) {