Commit b7c4171f authored by Thibault Saunier's avatar Thibault Saunier 🌵

nlesource: When standalone consider object.duration==0 as not set

nleobject.duration defaults to 0, but this is pretty unintuitive for
end user in the case nlesource is use standalone, just consider
duration=0 equivalent to duration=GST_CLOCK_TIME_NONE as it makes
the element much simpler to use, we could actually forbid 0 as a value
in the future.

Also take into account potential CLOCK_TIME_NONE
parent 0be8bc9d
Pipeline #110120 failed with stages
in 64 minutes and 28 seconds
......@@ -535,12 +535,18 @@ nle_source_prepare (NleObject * object)
priv->ghostedpad = pad;
if (object->in_composition == FALSE) {
GstClockTime start =
GST_CLOCK_TIME_IS_VALID (object->inpoint) ? object->inpoint : 0;
GstClockTime stop = GST_CLOCK_TIME_NONE;
if (GST_CLOCK_TIME_IS_VALID (object->inpoint)
&& GST_CLOCK_TIME_IS_VALID (object->duration) && object->duration)
stop = object->inpoint + object->duration;
g_mutex_lock (&source->priv->seek_lock);
source->priv->seek_event =
gst_event_new_seek (1.0, GST_FORMAT_TIME,
source->priv->seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, object->inpoint, GST_SEEK_TYPE_SET,
object->inpoint + object->duration);
GST_SEEK_TYPE_SET, start, GST_SEEK_TYPE_SET, stop);
g_mutex_unlock (&source->priv->seek_lock);
GST_OBJECT_LOCK (source);
priv->probeid = gst_pad_add_probe (pad,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment