Skip to content

Commit

Permalink
Merge pull request #3 from mariannasb/segment-handling-patch
Browse files Browse the repository at this point in the history
Fix segment handling in interpipesrc
  • Loading branch information
mariannasb authored Aug 9, 2021
2 parents dba90fc + b261bf6 commit 7d09a3a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion gst/interpipe/gstinterpipesrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,22 @@ gst_inter_pipe_src_create (GstBaseSrc * base, guint64 offset, guint size,
GST_EVENT_TYPE_NAME (serial_event));

serial_event = g_queue_pop_head (src->pending_serial_events);
gst_pad_push_event (srcpad, serial_event);

if (GST_EVENT_TYPE (serial_event) == GST_EVENT_SEGMENT) {
const GstSegment *segment = NULL;

gst_event_parse_segment (serial_event, &segment);
g_assert (segment != NULL);

GST_DEBUG_OBJECT (src,
"Update new segment %" GST_PTR_FORMAT, serial_event);
if (!gst_base_src_new_segment (base, segment)) {
GST_ERROR_OBJECT (src,
"Couldn't set new segment %" GST_PTR_FORMAT, serial_event);
}
} else {
gst_pad_push_event (srcpad, serial_event);
}
} else {
GST_DEBUG_OBJECT (src, "Event %s timestamp is greater than the "
"buffer timestamp, can't send serial event yet",
Expand Down

0 comments on commit 7d09a3a

Please sign in to comment.