Skip to content

Commit 9416874

Browse files
author
Alexander Matveev
committed
8297362: EOS might not be delivered by progressbuffer in some cases
Reviewed-by: kcr, arapte
1 parent e64e129 commit 9416874

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

modules/javafx.media/src/main/native/gstreamer/plugins/progressbuffer/progressbuffer.c

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -174,6 +174,7 @@ static gpointer progress_buffer_range_monitor(ProgressBuffer *element);
174174
#endif
175175

176176
static void progress_buffer_set_pending_event(ProgressBuffer *element, GstEvent* new_event);
177+
static GstEventType progress_buffer_get_pending_event_type(ProgressBuffer *element);
177178

178179
/**
179180
* progress_buffer_class_init()
@@ -513,6 +514,14 @@ static void progress_buffer_set_pending_event(ProgressBuffer *element, GstEvent*
513514
element->pending_src_event = new_event;
514515
}
515516

517+
static GstEventType progress_buffer_get_pending_event_type(ProgressBuffer *element)
518+
{
519+
if (element->pending_src_event)
520+
return GST_EVENT_TYPE(element->pending_src_event);
521+
else
522+
return GST_EVENT_UNKNOWN;
523+
}
524+
516525
/**
517526
* send_position_message
518527
* Sends application message on the BUS with the following parameters:
@@ -590,7 +599,11 @@ static GstFlowReturn progress_buffer_enqueue_item(ProgressBuffer *element, GstMi
590599
if (element->sink_segment.position < element->sink_segment.stop)
591600
element->sink_segment.stop = element->sink_segment.position;
592601

593-
progress_buffer_set_pending_event(element, NULL);
602+
// Do not clear pending EOS event if set. If progress buffer
603+
// set pending EOS event we need to deliver it, otherwise
604+
// downstream will wait for data forever.
605+
if (progress_buffer_get_pending_event_type(element) != GST_EVENT_EOS)
606+
progress_buffer_set_pending_event(element, NULL);
594607

595608
signal = send_position_message(element, TRUE);
596609
gst_event_unref(event); // INLINE - gst_event_unref()

modules/javafx.media/src/main/native/xcode_project/JFXMedia.xcodeproj/project.pbxproj

+5-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
/* End PBXContainerItemProxy section */
117117

118118
/* Begin PBXFileReference section */
119+
114ECB8E2928543700BE8CE2 /* plugins */ = {isa = PBXFileReference; lastKnownFileType = folder; name = plugins; path = ../gstreamer/plugins; sourceTree = "<group>"; };
119120
652BECE8199BCFD4007217BB /* NullAudioEqualizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullAudioEqualizer.h; sourceTree = "<group>"; };
120121
652BECEB199BD515007217BB /* NullAudioSpectrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullAudioSpectrum.h; sourceTree = "<group>"; };
121122
652BECED199BDB28007217BB /* NativeAudioEqualizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeAudioEqualizer.cpp; sourceTree = "<group>"; };
@@ -613,6 +614,7 @@
613614
65FF278A1991545E006BF9EE = {
614615
isa = PBXGroup;
615616
children = (
617+
114ECB8E2928543700BE8CE2 /* plugins */,
616618
B3BFE7721D7A15FA00E48712 /* glib */,
617619
B3BFE7711D7A159A00E48712 /* gstreamer-lite */,
618620
65989B121991823700319296 /* build_prereqs.sh */,
@@ -712,6 +714,7 @@
712714
developmentRegion = English;
713715
hasScannedForEncodings = 0;
714716
knownRegions = (
717+
English,
715718
en,
716719
Base,
717720
);
@@ -948,7 +951,7 @@
948951
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
949952
GCC_WARN_UNUSED_FUNCTION = YES;
950953
GCC_WARN_UNUSED_VARIABLE = YES;
951-
GLIB_LITE_DIR = "../gstreamer/3rd_party/glib";
954+
GLIB_LITE_DIR = ../gstreamer/3rd_party/glib;
952955
GSTREAMER_LITE_DIR = "../gstreamer/gstreamer-lite";
953956
HEADER_SEARCH_PATHS = (
954957
"$(inherited)",
@@ -1000,7 +1003,7 @@
10001003
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
10011004
GCC_WARN_UNUSED_FUNCTION = YES;
10021005
GCC_WARN_UNUSED_VARIABLE = YES;
1003-
GLIB_LITE_DIR = "../gstreamer/3rd_party/glib";
1006+
GLIB_LITE_DIR = ../gstreamer/3rd_party/glib;
10041007
GSTREAMER_LITE_DIR = "../gstreamer/gstreamer-lite";
10051008
HEADER_SEARCH_PATHS = (
10061009
"$(inherited)",

0 commit comments

Comments
 (0)