From d607daaf183eb3e068ec53bbf373ea3a63991aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Fri, 10 Jul 2009 21:42:19 +0100 Subject: mimenc: Only enable paused mode if the property is true --- ext/mimic/gstmimenc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c index 66c74230..84f34012 100644 --- a/ext/mimic/gstmimenc.c +++ b/ext/mimic/gstmimenc.c @@ -559,6 +559,7 @@ gst_mimenc_change_state (GstElement * element, GstStateChange transition) { GstMimEnc *mimenc = GST_MIMENC (element); GstStateChangeReturn ret; + gboolean paused_mode; switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: @@ -605,10 +606,13 @@ gst_mimenc_change_state (GstElement * element, GstStateChange transition) if (mimenc->last_buffer == GST_CLOCK_TIME_NONE) mimenc->last_buffer = gst_clock_get_time (GST_ELEMENT_CLOCK (mimenc)) - GST_ELEMENT_CAST (mimenc)->base_time; + paused_mode = mimenc->paused_mode; GST_OBJECT_UNLOCK (mimenc); - if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) { - ret = GST_STATE_CHANGE_FAILURE; - GST_ERROR_OBJECT (mimenc, "Can not start task"); + if (paused_mode) { + if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) { + ret = GST_STATE_CHANGE_FAILURE; + GST_ERROR_OBJECT (mimenc, "Can not start task"); + } } break; default: -- cgit v1.2.1