gst-plugins-good: matroskamux: create streamable output if downstream is not seekable
Tim Müller
tpm at kemper.freedesktop.org
Sat Feb 25 07:59:37 PST 2012
Module: gst-plugins-good
Branch: master
Commit: f4afccff5c8c8f4163544c40b6e671a5b98d54c3
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=f4afccff5c8c8f4163544c40b6e671a5b98d54c3
Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date: Sat Feb 25 15:40:39 2012 +0000
matroskamux: 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 webmmux ! appsink creating seemingly
corrupted output if streamable has not been set to true.
---
gst/matroska/matroska-mux.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index d79c222..fb86ef4 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -2355,6 +2355,29 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
guint32 segment_uid[4];
GTimeVal time = { 0, 0 };
+ /* 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");
+ }
+ }
+
if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
ebml->caps = gst_caps_new_simple ("video/webm", NULL);
} else {
More information about the gstreamer-commits
mailing list