mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 13:25:56 +00:00
inputselector: Use the start time (i.e. timestamp) as the last stop
Using the end time makes it impossible to replace buffers, which is
a big problem for subtitles that could have very long durations.
Merged from gst-plugins-base, 27034be461
.
This commit is contained in:
parent
8b2d4ad8a3
commit
a1f6660655
1 changed files with 5 additions and 5 deletions
|
@ -557,7 +557,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GstPad *active_sinkpad;
|
GstPad *active_sinkpad;
|
||||||
GstPad *prev_active_sinkpad;
|
GstPad *prev_active_sinkpad;
|
||||||
GstSelectorPad *selpad;
|
GstSelectorPad *selpad;
|
||||||
GstClockTime end_time, duration;
|
GstClockTime start_time, end_time, duration;
|
||||||
GstSegment *seg;
|
GstSegment *seg;
|
||||||
GstEvent *close_event = NULL, *start_event = NULL;
|
GstEvent *close_event = NULL, *start_event = NULL;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -577,10 +577,10 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||||
|
|
||||||
/* update the segment on the srcpad */
|
/* update the segment on the srcpad */
|
||||||
end_time = GST_BUFFER_TIMESTAMP (buf);
|
start_time = GST_BUFFER_TIMESTAMP (buf);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (end_time)) {
|
if (GST_CLOCK_TIME_IS_VALID (start_time)) {
|
||||||
GST_DEBUG_OBJECT (pad, "received start time %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (pad, "received start time %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (end_time));
|
GST_TIME_ARGS (start_time));
|
||||||
duration = GST_BUFFER_DURATION (buf);
|
duration = GST_BUFFER_DURATION (buf);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (duration))
|
if (GST_CLOCK_TIME_IS_VALID (duration))
|
||||||
end_time += duration;
|
end_time += duration;
|
||||||
|
@ -588,7 +588,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GST_TIME_ARGS (end_time));
|
GST_TIME_ARGS (end_time));
|
||||||
|
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
gst_segment_set_last_stop (seg, seg->format, end_time);
|
gst_segment_set_last_stop (seg, seg->format, start_time);
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue