mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
qtmux: handle issues correctly when downstream is not seekable
The streamable property only make sense for fragmented formats. For regular MP4, when downstream is not seekable we can't rewrite the headers, so qtmux can only work with fast-start=TRUE, where the headers are written finishing the file. For fragmented MP4, when streamable is not seekable and the streamable property is FALSE, we must enforce streamable=TRUE warning the user about this change https://bugzilla.gnome.org/show_bug.cgi?id=707242
This commit is contained in:
parent
9ae5082204
commit
cfefdaebb6
1 changed files with 23 additions and 7 deletions
|
@ -1615,6 +1615,7 @@ serialize_error:
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_qt_mux_start_file (GstQTMux * qtmux)
|
gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
{
|
{
|
||||||
|
GstQTMuxClass *qtmux_klass = (GstQTMuxClass *) (G_OBJECT_GET_CLASS (qtmux));
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
@ -1648,14 +1649,20 @@ gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
GST_WARNING_OBJECT (qtmux, "downstream did not handle seeking query");
|
GST_WARNING_OBJECT (qtmux, "downstream did not handle seeking query");
|
||||||
seekable = FALSE;
|
seekable = FALSE;
|
||||||
}
|
}
|
||||||
if (!seekable) {
|
|
||||||
qtmux->streamable = TRUE;
|
|
||||||
g_object_notify (G_OBJECT (qtmux), "streamable");
|
|
||||||
GST_WARNING_OBJECT (qtmux, "downstream is not seekable, but "
|
|
||||||
"streamable=false. Will ignore that and create streamable output "
|
|
||||||
"instead");
|
|
||||||
}
|
|
||||||
gst_query_unref (query);
|
gst_query_unref (query);
|
||||||
|
if (!seekable) {
|
||||||
|
if (qtmux_klass->format != GST_QT_MUX_FORMAT_ISML) {
|
||||||
|
if (!qtmux->fast_start) {
|
||||||
|
goto not_seekable_error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
GST_WARNING_OBJECT (qtmux, "downstream is not seekable, but "
|
||||||
|
"streamable=false. Will ignore that and create streamable output "
|
||||||
|
"instead");
|
||||||
|
qtmux->streamable = TRUE;
|
||||||
|
g_object_notify (G_OBJECT (qtmux), "streamable");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* let downstream know we think in BYTES and expect to do seeking later on */
|
/* let downstream know we think in BYTES and expect to do seeking later on */
|
||||||
|
@ -1767,6 +1774,15 @@ gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
exit:
|
exit:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
not_seekable_error:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (qtmux, STREAM, FAILED,
|
||||||
|
("Downstream is not seekable and headers can't be rewritten"),
|
||||||
|
GST_ERROR_SYSTEM);
|
||||||
|
GST_OBJECT_UNLOCK (qtmux);
|
||||||
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
open_failed:
|
open_failed:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue