mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
matroskademux: only unlock pad when it was locked
This fixes the mutex being unlocked too much and ending up allowing other threads when they should not. https://bugzilla.gnome.org/show_bug.cgi?id=671776
This commit is contained in:
parent
38372eb199
commit
ee1be9236f
1 changed files with 8 additions and 2 deletions
|
@ -1910,6 +1910,7 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
|
||||||
GstMatroskaTrackContext *track = NULL;
|
GstMatroskaTrackContext *track = NULL;
|
||||||
GstSegment seeksegment = { 0, };
|
GstSegment seeksegment = { 0, };
|
||||||
gboolean update = TRUE;
|
gboolean update = TRUE;
|
||||||
|
gboolean pad_locked = FALSE;
|
||||||
|
|
||||||
if (pad)
|
if (pad)
|
||||||
track = gst_pad_get_element_private (pad);
|
track = gst_pad_get_element_private (pad);
|
||||||
|
@ -2011,6 +2012,7 @@ next:
|
||||||
* forever. */
|
* forever. */
|
||||||
GST_DEBUG_OBJECT (demux, "Waiting for streaming to stop");
|
GST_DEBUG_OBJECT (demux, "Waiting for streaming to stop");
|
||||||
GST_PAD_STREAM_LOCK (demux->common.sinkpad);
|
GST_PAD_STREAM_LOCK (demux->common.sinkpad);
|
||||||
|
pad_locked = TRUE;
|
||||||
|
|
||||||
/* pull mode without index can do some scanning */
|
/* pull mode without index can do some scanning */
|
||||||
if (!demux->streaming && !entry) {
|
if (!demux->streaming && !entry) {
|
||||||
|
@ -2093,13 +2095,17 @@ exit:
|
||||||
(GstTaskFunction) gst_matroska_demux_loop, demux->common.sinkpad);
|
(GstTaskFunction) gst_matroska_demux_loop, demux->common.sinkpad);
|
||||||
|
|
||||||
/* streaming can continue now */
|
/* streaming can continue now */
|
||||||
GST_PAD_STREAM_UNLOCK (demux->common.sinkpad);
|
if (pad_locked) {
|
||||||
|
GST_PAD_STREAM_UNLOCK (demux->common.sinkpad);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
seek_error:
|
seek_error:
|
||||||
{
|
{
|
||||||
GST_PAD_STREAM_UNLOCK (demux->common.sinkpad);
|
if (pad_locked) {
|
||||||
|
GST_PAD_STREAM_UNLOCK (demux->common.sinkpad);
|
||||||
|
}
|
||||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL), ("Got a seek error"));
|
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL), ("Got a seek error"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue