mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
uridecodebin3: Use lock when checking input/output items
Otherwise there is the risk that the play items list could have changed in between Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7609>
This commit is contained in:
parent
e1e48b9fea
commit
cb25b1e95e
1 changed files with 11 additions and 2 deletions
|
@ -675,10 +675,19 @@ db_src_probe (GstPad * pad, GstPadProbeInfo * info, OutputPad * output)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_EOS:
|
||||
{
|
||||
gboolean drop_event = FALSE;
|
||||
GstPlayItem *last;
|
||||
|
||||
PLAY_ITEMS_LOCK (uridecodebin);
|
||||
last = g_list_last (uridecodebin->play_items)->data;
|
||||
|
||||
/* If there is a next input, drop the EOS event */
|
||||
if (uridecodebin->input_item != uridecodebin->output_item ||
|
||||
uridecodebin->input_item !=
|
||||
g_list_last (uridecodebin->play_items)->data) {
|
||||
uridecodebin->input_item != last) {
|
||||
drop_event = TRUE;
|
||||
}
|
||||
PLAY_ITEMS_UNLOCK (uridecodebin);
|
||||
if (drop_event) {
|
||||
GST_DEBUG_OBJECT (uridecodebin,
|
||||
"Dropping EOS event because in gapless mode");
|
||||
return GST_PAD_PROBE_DROP;
|
||||
|
|
Loading…
Reference in a new issue