mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
mimenc: Only enable paused mode if the property is true
This commit is contained in:
parent
011e9c10f0
commit
d607daaf18
1 changed files with 7 additions and 3 deletions
|
@ -559,6 +559,7 @@ gst_mimenc_change_state (GstElement * element, GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstMimEnc *mimenc = GST_MIMENC (element);
|
GstMimEnc *mimenc = GST_MIMENC (element);
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
gboolean paused_mode;
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
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)
|
if (mimenc->last_buffer == GST_CLOCK_TIME_NONE)
|
||||||
mimenc->last_buffer = gst_clock_get_time (GST_ELEMENT_CLOCK (mimenc))
|
mimenc->last_buffer = gst_clock_get_time (GST_ELEMENT_CLOCK (mimenc))
|
||||||
- GST_ELEMENT_CAST (mimenc)->base_time;
|
- GST_ELEMENT_CAST (mimenc)->base_time;
|
||||||
|
paused_mode = mimenc->paused_mode;
|
||||||
GST_OBJECT_UNLOCK (mimenc);
|
GST_OBJECT_UNLOCK (mimenc);
|
||||||
if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) {
|
if (paused_mode) {
|
||||||
ret = GST_STATE_CHANGE_FAILURE;
|
if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) {
|
||||||
GST_ERROR_OBJECT (mimenc, "Can not start task");
|
ret = GST_STATE_CHANGE_FAILURE;
|
||||||
|
GST_ERROR_OBJECT (mimenc, "Can not start task");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue