mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
concat: fix locking in SEGMENT event handler
concat->current_start_offset needs the lock taken for safe access, as it can be accessed from outside of the streaming thread, eg in release_pad. An early break is also added for an error case. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/822>
This commit is contained in:
parent
ab4ec53d56
commit
96800c0b4a
1 changed files with 7 additions and 3 deletions
|
@ -556,7 +556,6 @@ gst_concat_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
self->format = spad->segment.format;
|
||||
GST_DEBUG_OBJECT (self, "Operating in %s format",
|
||||
gst_format_get_name (self->format));
|
||||
g_mutex_unlock (&self->lock);
|
||||
} else if (self->format != spad->segment.format) {
|
||||
g_mutex_unlock (&self->lock);
|
||||
GST_ELEMENT_ERROR (self, CORE, FAILED, (NULL),
|
||||
|
@ -564,16 +563,19 @@ gst_concat_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
gst_format_get_name (self->format),
|
||||
gst_format_get_name (spad->segment.format)));
|
||||
ret = FALSE;
|
||||
} else {
|
||||
g_mutex_unlock (&self->lock);
|
||||
break;
|
||||
}
|
||||
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
||||
if (!gst_concat_pad_wait (spad, self)) {
|
||||
ret = FALSE;
|
||||
} else {
|
||||
GstSegment segment = spad->segment;
|
||||
GstEvent *topush;
|
||||
|
||||
g_mutex_lock (&self->lock);
|
||||
|
||||
if (adjust_base) {
|
||||
/* We know no duration */
|
||||
segment.duration = -1;
|
||||
|
@ -607,6 +609,8 @@ gst_concat_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
topush = gst_event_new_segment (&segment);
|
||||
gst_event_set_seqnum (topush, gst_event_get_seqnum (event));
|
||||
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
||||
gst_pad_push_event (self->srcpad, topush);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue