From c0f505e80e44b5bae06d4ab05be6bfa5236cc3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 May 2017 11:42:09 +0200 Subject: [PATCH] qtmux: Calculate with reserved moov size instead of last moov size We have some padding added after the initial moov, so a bigger updated moov can be handled to some degree and is expected. Previously we just ignored the padding and errored out in cases when the padding would've just been enough. --- gst/isomp4/gstqtmux.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 4d89688bb9..7e45f39986 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -3395,7 +3395,6 @@ gst_qt_mux_stop_file (GstQTMux * qtmux) { GstSegment segment; - guint old_header_size = qtmux->last_moov_size; gst_segment_init (&segment, GST_FORMAT_BYTES); segment.start = qtmux->moov_pos; @@ -3407,14 +3406,10 @@ gst_qt_mux_stop_file (GstQTMux * qtmux) if (ret != GST_FLOW_OK) return ret; - if (old_header_size < qtmux->last_moov_size) { - GST_ELEMENT_ERROR (qtmux, STREAM, MUX, (NULL), - ("Not enough free reserved space")); - ret = GST_FLOW_ERROR; - } else if (old_header_size > qtmux->last_moov_size) { + if (qtmux->reserved_moov_size > qtmux->last_moov_size) { ret = gst_qt_mux_send_free_atom (qtmux, NULL, - old_header_size - qtmux->last_moov_size, TRUE); + qtmux->reserved_moov_size - qtmux->last_moov_size, TRUE); } if (ret != GST_FLOW_OK)