qtmoovrecover: Don't leak the static recursive mutex

This commit is contained in:
Sebastian Dröge 2011-04-14 13:43:06 +02:00
parent 0b9cf7e47d
commit bf046e0430
2 changed files with 4 additions and 5 deletions

View file

@ -351,9 +351,8 @@ gst_qt_moov_recover_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
qtmr->task = gst_task_create (gst_qt_moov_recover_run, qtmr);
qtmr->task_mutex = g_new (GStaticRecMutex, 1);
g_static_rec_mutex_init (qtmr->task_mutex);
gst_task_set_lock (qtmr->task, qtmr->task_mutex);
g_static_rec_mutex_init (&qtmr->task_mutex);
gst_task_set_lock (qtmr->task, &qtmr->task_mutex);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
gst_task_start (qtmr->task);
@ -373,7 +372,7 @@ gst_qt_moov_recover_change_state (GstElement * element,
g_assert (gst_task_get_state (qtmr->task) == GST_TASK_STOPPED);
gst_object_unref (qtmr->task);
qtmr->task = NULL;
g_static_rec_mutex_free (qtmr->task_mutex);
g_static_rec_mutex_free (&qtmr->task_mutex);
break;
default:
break;

View file

@ -66,7 +66,7 @@ struct _GstQTMoovRecover
GstPipeline pipeline;
GstTask *task;
GStaticRecMutex *task_mutex;
GStaticRecMutex task_mutex;
/* properties */
gboolean faststart_mode;