From 34a5b93637c40b782ab7a768c31e84ed1737981c Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 9 Jul 2013 15:33:18 +0200 Subject: [PATCH] osxvideosink: default to the main in case we are not setup yet --- sys/osxvideo/osxvideosink.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/osxvideo/osxvideosink.m b/sys/osxvideo/osxvideosink.m index 6d4e9f3..3f628e5 100644 --- a/sys/osxvideo/osxvideosink.m +++ b/sys/osxvideo/osxvideosink.m @@ -90,9 +90,16 @@ gst_osx_video_sink_call_from_main_thread(GstOSXVideoSink *osxvideosink, NSObject * object, SEL function, NSObject *data, BOOL waitUntilDone) { + NSThread *thread; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [object performSelector:function onThread:sink_class->ns_app_thread + if (sink_class->ns_app_thread == NULL){ + thread = [NSThread mainThread]; + } else { + thread = sink_class->ns_app_thread; + } + + [object performSelector:function onThread:thread withObject:data waitUntilDone:waitUntilDone]; [pool release]; } -- 2.7.4