diff options
author | Olivier CrĂȘte <tester@tester.ca> | 2009-08-12 12:21:33 -0400 |
---|---|---|
committer | Olivier CrĂȘte <tester@tester.ca> | 2009-08-12 17:35:14 -0400 |
commit | 6001c6b5c0e438b4bab21a2babc0bad6cf6630a9 (patch) | |
tree | b134549f71f8aa83e9394b5f52f87927a2741916 /ext | |
parent | 402aad7e871ab242ef16c8c715c50e5a2c236f9a (diff) | |
download | gst-plugins-bad-6001c6b5c0e438b4bab21a2babc0bad6cf6630a9.tar.gz gst-plugins-bad-6001c6b5c0e438b4bab21a2babc0bad6cf6630a9.tar.bz2 gst-plugins-bad-6001c6b5c0e438b4bab21a2babc0bad6cf6630a9.zip |
mimenc: Refuse to go playing in paused-mode without clock
Only try to use the clock in if paused-mode is set and refuse to go playing
in paused-mode without it.
Fixes bug #591538
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mimic/gstmimenc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c index 4a65b9fd..e9462094 100644 --- a/ext/mimic/gstmimenc.c +++ b/ext/mimic/gstmimenc.c @@ -593,10 +593,19 @@ gst_mimenc_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_PLAYING: GST_OBJECT_LOCK (mimenc); mimenc->stop_paused_mode = FALSE; - 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; + if (paused_mode) { + if (!GST_ELEMENT_CLOCK (mimenc)) { + GST_OBJECT_UNLOCK (mimenc); + GST_ELEMENT_ERROR (mimenc, RESOURCE, FAILED, + ("Using paused-mode requires a clock, but no clock was provided" + " to the element"), (NULL)); + return GST_STATE_CHANGE_FAILURE; + } + 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; + } GST_OBJECT_UNLOCK (mimenc); if (paused_mode) { if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) { |