mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +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/7682>
This commit is contained in:
parent
a92f4be40c
commit
f197bc01a2
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)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_EOS:
|
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 there is a next input, drop the EOS event */
|
||||||
if (uridecodebin->input_item != uridecodebin->output_item ||
|
if (uridecodebin->input_item != uridecodebin->output_item ||
|
||||||
uridecodebin->input_item !=
|
uridecodebin->input_item != last) {
|
||||||
g_list_last (uridecodebin->play_items)->data) {
|
drop_event = TRUE;
|
||||||
|
}
|
||||||
|
PLAY_ITEMS_UNLOCK (uridecodebin);
|
||||||
|
if (drop_event) {
|
||||||
GST_DEBUG_OBJECT (uridecodebin,
|
GST_DEBUG_OBJECT (uridecodebin,
|
||||||
"Dropping EOS event because in gapless mode");
|
"Dropping EOS event because in gapless mode");
|
||||||
return GST_PAD_PROBE_DROP;
|
return GST_PAD_PROBE_DROP;
|
||||||
|
|
Loading…
Reference in a new issue