avfvideosrc: fix deadlock draining queue from the same thread
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Thu, 4 Apr 2013 15:59:09 +0000 (15:59 +0000)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 15 Apr 2013 07:02:37 +0000 (09:02 +0200)
sys/applemedia/avfvideosrc.m

index 236aa75..3c570b1 100644 (file)
@@ -601,7 +601,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
 
 - (void)waitForQueueToDrain:(dispatch_queue_t)dispatchQueue
 {
-  dispatch_sync (dispatchQueue, ^{});
+  if (dispatchQueue != dispatch_get_current_queue())
+      dispatch_sync (dispatchQueue, ^{});
 }
 
 @end