From: Andoni Morales Alastruey Date: Tue, 9 Jul 2013 13:33:18 +0000 (+0200) Subject: osxvideosink: default to the main in case we are not setup yet X-Git-Tag: 1.1.2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34a5b93637c40b782ab7a768c31e84ed1737981c;p=platform%2Fupstream%2Fgst-plugins-good.git osxvideosink: default to the main in case we are not setup yet --- 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]; }