adaptivedemux2: period: Rename 'closed' flag to 'has_next_period'
authorJan Schmidt <jan@centricular.com>
Mon, 11 Jul 2022 15:24:31 +0000 (01:24 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 4 Aug 2022 12:43:36 +0000 (13:43 +0100)
The flag is used to tell the output loop that a
next period is present, since the output loop
can't call the gst_adaptive_demux_has_next_period()
method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>

subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c
subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.h

index 8925454..9d4186f 100644 (file)
@@ -1316,8 +1316,8 @@ gst_adaptive_demux_start_new_period (GstAdaptiveDemux * demux)
   }
 
   if (demux->input_period) {
-    GST_DEBUG_OBJECT (demux, "Closing previous period");
-    demux->input_period->closed = TRUE;
+    GST_DEBUG_OBJECT (demux, "Marking that previous period has a next one");
+    demux->input_period->has_next_period = TRUE;
   }
   GST_DEBUG_OBJECT (demux, "Setting up new period");
 
@@ -3605,7 +3605,7 @@ restart:
     goto restart;
 
   if (global_output_position == GST_CLOCK_STIME_NONE
-      && demux->output_period->closed) {
+      && demux->output_period->has_next_period) {
     GST_DEBUG_OBJECT (demux, "Period %d is drained, switching to next period",
         demux->output_period->period_num);
     if (!gst_adaptive_demux_advance_output_period (demux)) {
index 498b983..c0b6a1b 100644 (file)
@@ -375,8 +375,8 @@ struct _GstAdaptiveDemuxPeriod
   gboolean prepared;
 
 
-  /* TRUE if the period no longer receives any data (i.e. it is closed) */
-  gboolean closed;
+  /* TRUE if there is another period after this one */
+  gboolean has_next_period;
   
   /* An increasing unique identifier for the period.
    *