flvmux: Remove custom get_next_time implementation
authorOlivier Crête <olivier.crete@collabora.com>
Mon, 23 Apr 2018 17:29:30 +0000 (13:29 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Wed, 16 May 2018 20:23:36 +0000 (22:23 +0200)
GstAggregator now does the same thing in the simple implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486

gst/flv/gstflvmux.c

index 516d45c..2a1237a 100644 (file)
@@ -1793,29 +1793,6 @@ gst_flv_mux_set_property (GObject * object,
 }
 
 static GstClockTime
-gst_flv_mux_get_next_time_for_segment (GstAggregator * aggregator,
-    const GstSegment * segment)
-{
-  GstClockTime next_time;
-
-  GST_OBJECT_LOCK (aggregator);
-  if (segment->position == -1 || segment->position < segment->start)
-    next_time = segment->start;
-  else
-    next_time = segment->position;
-
-  if (segment->stop != -1 && next_time > segment->stop)
-    next_time = segment->stop;
-
-  next_time = gst_segment_to_running_time (segment, GST_FORMAT_TIME, next_time);
-  GST_OBJECT_UNLOCK (aggregator);
-
-  GST_DEBUG_OBJECT (aggregator, "next_time: %" GST_TIME_FORMAT,
-      GST_TIME_ARGS (next_time));
-  return next_time;
-}
-
-static GstClockTime
 gst_flv_mux_get_next_time (GstAggregator * aggregator)
 {
   GstFlvMux *mux = GST_FLV_MUX (aggregator);
@@ -1833,8 +1810,7 @@ gst_flv_mux_get_next_time (GstAggregator * aggregator)
     goto wait_for_data;
   GST_OBJECT_UNLOCK (aggregator);
 
-  return gst_flv_mux_get_next_time_for_segment (aggregator,
-      &GST_AGGREGATOR_PAD (aggregator->srcpad)->segment);
+  return gst_aggregator_simple_get_next_time (aggregator);
 
 wait_for_data:
   GST_OBJECT_UNLOCK (aggregator);