Commit 422cf792 authored by Olivier Crête's avatar Olivier Crête 👻

flvmux: Wait for caps from both srcs before writing header

Wait for caps on all pads to start writing data even when source is live.

Includes unit test by Havard Graff that simulates it.

https://bugzilla.gnome.org/show_bug.cgi?id=794722
parent c3373976
...@@ -1812,6 +1812,19 @@ gst_flv_mux_get_next_time_for_segment (GstAggregator * aggregator, ...@@ -1812,6 +1812,19 @@ gst_flv_mux_get_next_time_for_segment (GstAggregator * aggregator,
static GstClockTime static GstClockTime
gst_flv_mux_get_next_time (GstAggregator * aggregator) gst_flv_mux_get_next_time (GstAggregator * aggregator)
{ {
GstFlvMux *mux = GST_FLV_MUX (aggregator);
GST_OBJECT_LOCK (aggregator);
if (mux->state == GST_FLV_MUX_STATE_HEADER &&
((mux->audio_pad && mux->audio_pad->codec == G_MAXUINT) ||
(mux->video_pad && mux->video_pad->codec == G_MAXUINT)))
goto wait_for_data;
GST_OBJECT_UNLOCK (aggregator);
return gst_flv_mux_get_next_time_for_segment (aggregator, return gst_flv_mux_get_next_time_for_segment (aggregator,
&GST_AGGREGATOR_PAD (aggregator->srcpad)->segment); &GST_AGGREGATOR_PAD (aggregator->srcpad)->segment);
wait_for_data:
GST_OBJECT_UNLOCK (aggregator);
return GST_CLOCK_TIME_NONE;
} }
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment