1 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4091
3 --- gst-plugins-good/gst/flv/gstflvmux.c
4 +++ gst-plugins-good/gst/flv/gstflvmux.c
5 @@ -2001,16 +2001,12 @@
9 + if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS_OR_PTS (buffer))) {
10 + t = gst_flv_mux_segment_to_running_time (&apad->segment,
11 + GST_BUFFER_DTS_OR_PTS (buffer));
13 - t = gst_flv_mux_segment_to_running_time (&apad->segment,
14 - GST_BUFFER_DTS_OR_PTS (buffer));
16 + if (!GST_CLOCK_TIME_IS_VALID (best_ts) ||
17 - if (!GST_CLOCK_TIME_IS_VALID (t)) {
18 - GST_WARNING_OBJECT (apad, "Buffer has no timestamp: %" GST_PTR_FORMAT,
20 - gst_object_replace ((GstObject **) & best, GST_OBJECT (apad));
21 - best_ts = GST_CLOCK_TIME_NONE;
23 - } else if (!GST_CLOCK_TIME_IS_VALID (best_ts) ||
24 (GST_CLOCK_TIME_IS_VALID (t) && t < best_ts)) {
25 gst_object_replace ((GstObject **) & best, GST_OBJECT (apad));
27 @@ -2234,20 +2230,21 @@
28 gst_flv_mux_get_next_time (GstAggregator * aggregator)
30 GstFlvMux *mux = GST_FLV_MUX (aggregator);
31 + GstAggregatorPad *agg_audio_pad = GST_AGGREGATOR_PAD_CAST (mux->audio_pad);
32 + GstAggregatorPad *agg_video_pad = GST_AGGREGATOR_PAD_CAST (mux->video_pad);
33 - GstFlvMuxPad *best = NULL;
34 - GstClockTime best_time = GST_CLOCK_TIME_NONE;
36 GST_OBJECT_LOCK (aggregator);
37 if (mux->state == GST_FLV_MUX_STATE_HEADER &&
38 ((mux->audio_pad && mux->audio_pad->codec == G_MAXUINT) ||
39 (mux->video_pad && mux->video_pad->codec == G_MAXUINT)))
42 + if (!((agg_audio_pad && gst_aggregator_pad_has_buffer (agg_audio_pad)) ||
43 + (agg_video_pad && gst_aggregator_pad_has_buffer (agg_video_pad))))
45 GST_OBJECT_UNLOCK (aggregator);
47 + return gst_aggregator_simple_get_next_time (aggregator);
48 - best = gst_flv_mux_find_best_pad (aggregator, &best_time, TRUE);
49 - gst_clear_object (&best);
54 GST_OBJECT_UNLOCK (aggregator);