Skip to content

Commit

Permalink
Fix segment handling in interpipesrc
Browse files Browse the repository at this point in the history
  • Loading branch information
mariannasb authored and Marianna Smidth Buschle committed Sep 30, 2021
1 parent 2917385 commit 14d9b49
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion gst/interpipe/gstinterpipesrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,27 @@ 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);
if (segment == NULL) {
GST_ERROR_OBJECT (src,
"Couldn't parse received segment %" GST_PTR_FORMAT, serial_event);
return GST_FLOW_ERROR;
}

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);
return GST_FLOW_ERROR;
}
} 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 14d9b49

Please sign in to comment.