From: Vivia Nikolaidou Date: Tue, 31 Mar 2020 11:10:35 +0000 (+0300) Subject: flvmux: Allow requesting streamable pads after header is written X-Git-Tag: 1.19.3~509^2~612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0855113c628abe0581fb5f410f9db20a65bca40;p=platform%2Fupstream%2Fgstreamer.git flvmux: Allow requesting streamable pads after header is written Allows us to request pads after writing header for streamable flv's. For non-streamable it doesn't make sense to request a new pad after writing the header, because the headers have been written already and we can't add the new stream. But for streamable, any clients that connect after the new pad has been added will be able to see both streams. Part-of: --- diff --git a/gst/flv/gstflvmux.c b/gst/flv/gstflvmux.c index 11ee8b6..c24692e 100644 --- a/gst/flv/gstflvmux.c +++ b/gst/flv/gstflvmux.c @@ -54,7 +54,7 @@ enum PROP_0, PROP_STREAMABLE, PROP_METADATACREATOR, - PROP_ENCODER + PROP_ENCODER, }; #define DEFAULT_STREAMABLE FALSE @@ -677,8 +677,10 @@ gst_flv_mux_create_new_pad (GstAggregator * agg, const gchar *name = NULL; gboolean video; - if (mux->state != GST_FLV_MUX_STATE_HEADER) { - GST_WARNING_OBJECT (mux, "Can't request pads after writing header"); + if (mux->state != GST_FLV_MUX_STATE_HEADER && !mux->streamable) { + GST_ELEMENT_WARNING (mux, STREAM, MUX, + ("Requested a late stream in a non-streamable file"), + ("Stream added after file started and therefore won't be playable")); return NULL; }