mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
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>
This commit is contained in:
parent
7c94b9c4b0
commit
1d4ecd0bde
1 changed files with 10 additions and 8 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue