osxvideosink: default to the main in case we are not setup yet

This commit is contained in:
Andoni Morales Alastruey 2013-07-09 15:33:18 +02:00
parent 0e321b87d4
commit 34a5b93637

View file

@ -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];
}