diff --git a/ChangeLog b/ChangeLog index ac98c168ca..5439691e46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-03-18 Andy Wingo + + * sys/osxvideo/osxvideosink.m + (gst_osx_video_sink_osxwindow_destroy) + (gst_osx_video_sink_osxwindow_new): Actually set a lock on the + task, whoopdee. + (cocoa_event_loop): Pacify the taymans by upping the usleepage to + 2 ms. + +2008-03-18 Andy Wingo + + * sys/osxvideo/osxvideosink.m + (gst_osx_video_sink_osxwindow_destroy) + (gst_osx_video_sink_osxwindow_new): Actually set a lock on the + task, whoopdee. + (cocoa_event_loop): Pacify the taymans by upping the usleepage to + 2 ms. + 2008-03-17 Tim-Philipp Müller Patch by: William M. Brack diff --git a/sys/osxvideo/osxvideosink.h b/sys/osxvideo/osxvideosink.h index bb16a42551..a21ac6b116 100644 --- a/sys/osxvideo/osxvideosink.h +++ b/sys/osxvideo/osxvideosink.h @@ -77,6 +77,7 @@ struct _GstOSXVideoSink { gint fps_d; GstTask *event_task; + GStaticRecMutex event_task_lock; /* Unused */ gint pixel_width, pixel_height; diff --git a/sys/osxvideo/osxvideosink.m b/sys/osxvideo/osxvideosink.m index 5ed1541cfc..f14cbcabbf 100644 --- a/sys/osxvideo/osxvideosink.m +++ b/sys/osxvideo/osxvideosink.m @@ -125,7 +125,7 @@ cocoa_event_loop (GstOSXVideoSink * vsink) untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; if ( event == nil ) { - g_usleep (100); + g_usleep (2000); break; } else { switch ([event type]) { @@ -280,8 +280,10 @@ gst_osx_video_sink_osxwindow_new (GstOSXVideoSink * osxvideosink, gint width, [NSApp setDelegate:[[GstAppDelegate alloc] init]]; [NSApp setRunning]; + g_static_rec_mutex_init (&osxvideosink->event_task_lock); osxvideosink->event_task = gst_task_create ((GstTaskFunction)cocoa_event_loop, osxvideosink); + gst_task_set_lock (osxvideosink->event_task, &osxvideosink->event_task_lock); gst_task_start (osxvideosink->event_task); } else { GstStructure *s; @@ -327,6 +329,7 @@ gst_osx_video_sink_osxwindow_destroy (GstOSXVideoSink * osxvideosink, gst_task_join (osxvideosink->event_task); gst_object_unref (osxvideosink->event_task); osxvideosink->event_task = NULL; + g_static_rec_mutex_free (&osxvideosink->event_task_lock); } g_free (osxwindow);