mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
flvmux: create streamable output if downstream is not seekable
Ignore the "streamable" property setting and create streamable output if downstream is known not to be seekable (as queried via a SEEKABLE query). Fixes pipelines like flvmux ! appsink possibly creating seemingly corrupted output if streamable has not been set to true.
This commit is contained in:
parent
f4afccff5c
commit
6b0dd47586
1 changed files with 23 additions and 0 deletions
|
@ -1106,6 +1106,29 @@ gst_flv_mux_write_header (GstFlvMux * mux)
|
||||||
GSList *l;
|
GSList *l;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
|
/* if not streaming, check if downstream is seekable */
|
||||||
|
if (!mux->streamable) {
|
||||||
|
gboolean seekable;
|
||||||
|
GstQuery *query;
|
||||||
|
|
||||||
|
query = gst_query_new_seeking (GST_FORMAT_BYTES);
|
||||||
|
if (gst_pad_peer_query (mux->srcpad, query)) {
|
||||||
|
gst_query_parse_seeking (query, NULL, &seekable, NULL, NULL);
|
||||||
|
GST_INFO_OBJECT (mux, "downstream is %sseekable", seekable ? "" : "not ");
|
||||||
|
if (!seekable) {
|
||||||
|
mux->streamable = TRUE;
|
||||||
|
g_object_notify (G_OBJECT (mux), "streamable");
|
||||||
|
GST_WARNING_OBJECT (mux, "downstream is not seekable, but "
|
||||||
|
"streamable=false. Will ignore that and create streamable output "
|
||||||
|
"instead");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* have to assume seeking is supported if query not handled downstream */
|
||||||
|
/* FIXME 0.11: change to query not handled => seeking not supported */
|
||||||
|
GST_WARNING_OBJECT (mux, "downstream did not handle seeking query");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
header = gst_flv_mux_create_header (mux);
|
header = gst_flv_mux_create_header (mux);
|
||||||
metadata = gst_flv_mux_create_metadata (mux, TRUE);
|
metadata = gst_flv_mux_create_metadata (mux, TRUE);
|
||||||
video_codec_data = NULL;
|
video_codec_data = NULL;
|
||||||
|
|
Loading…
Reference in a new issue