summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2021-06-10 11:46:35 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-06-23 16:03:38 +0000
commit1d4ecd0bde66a8fd5933358ed8c87f79826c0748 (patch)
treeb323f60dce1fc7ca73b659ac799013bd67075b2a /gst
parent7c94b9c4b0d70366bd016f4d2e22f06e576323cd (diff)
downloadgstreamer-plugins-bad-1d4ecd0bde66a8fd5933358ed8c87f79826c0748.tar.gz
avwait: Don't consider it a segment change if the segment is the same except for the position
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2319>
Diffstat (limited to 'gst')
-rw-r--r--gst/timecode/gstavwait.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gst/timecode/gstavwait.c b/gst/timecode/gstavwait.c
index 7f7305306..e089505c9 100644
--- a/gst/timecode/gstavwait.c
+++ b/gst/timecode/gstavwait.c
@@ -617,14 +617,15 @@ gst_avwait_vsink_event (GstPad * pad, GstObject * parent, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:{
- const GstSegment *segment;
+ GstSegment segment;
gboolean send_message = FALSE;
gboolean segment_changed;
g_mutex_lock (&self->mutex);
- gst_event_parse_segment (event, &segment);
- segment_changed = !gst_segment_is_equal (segment, &self->vsegment);
- self->vsegment = *segment;
+ gst_event_copy_segment (event, &segment);
+ segment.position = self->vsegment.position;
+ segment_changed = !gst_segment_is_equal (&segment, &self->vsegment);
+ self->vsegment = segment;
if (self->vsegment.format != GST_FORMAT_TIME) {
GST_ERROR_OBJECT (self, "Invalid segment format");
g_mutex_unlock (&self->mutex);
@@ -758,13 +759,14 @@ gst_avwait_asink_event (GstPad * pad, GstObject * parent, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:{
- const GstSegment *segment;
+ GstSegment segment;
gboolean segment_changed;
g_mutex_lock (&self->mutex);
- gst_event_parse_segment (event, &segment);
- segment_changed = !gst_segment_is_equal (segment, &self->asegment);
- self->asegment = *segment;
+ gst_event_copy_segment (event, &segment);
+ segment.position = self->asegment.position;
+ segment_changed = !gst_segment_is_equal (&segment, &self->asegment);
+ self->asegment = segment;
if (self->asegment.format != GST_FORMAT_TIME) {
GST_ERROR_OBJECT (self, "Invalid segment format");