diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-07-09 15:33:18 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-07-11 17:50:02 +0100 |
commit | 6c2b07ed1a455101bb4631e10dbbf3e31547dd9a (patch) | |
tree | a436406d105c88ec15659e0cdee57157cdf892f9 | |
parent | b5794f362a55f3745f85fde62039b2e8ff9526d7 (diff) | |
download | gst-plugins-good-6c2b07ed1a455101bb4631e10dbbf3e31547dd9a.tar.gz gst-plugins-good-6c2b07ed1a455101bb4631e10dbbf3e31547dd9a.tar.xz |
osxvideosink: default to the main in case we are not setup yet
-rw-r--r-- | sys/osxvideo/osxvideosink.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/osxvideo/osxvideosink.m b/sys/osxvideo/osxvideosink.m index f260b3eb0..912ae3526 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]; } |