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.
This commit is contained in:
Sebastian Dröge 2017-05-10 11:42:09 +02:00
parent 419f53259f
commit c0f505e80e

View file

@ -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)