From 6cb8c802f4c89a40683bd44d1109db1d679bb35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 14 Mar 2017 15:09:44 +0200 Subject: [PATCH] qtmux: Only create new chunks if we have more than a single stream There's no point in creating multiple chunks otherwise, it only wastes some bytes for storing the chunk offsets. --- gst/isomp4/gstqtmux.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 8d009b6ee4..a67b2e5e0a 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -3553,7 +3553,11 @@ find_best_pad (GstQTMux * qtmux, GstCollectPads * pads) GST_DEBUG_OBJECT (qtmux, "Reusing pad %s:%s", GST_DEBUG_PAD_NAME (best_pad->collect.pad)); } - } else { + } else if (qtmux->collect->data->next) { + /* Only switch pads if we have more than one, otherwise + * we can just put everything into a single chunk and save + * a few bytes of offsets + */ if (qtmux->current_pad) GST_DEBUG_OBJECT (qtmux, "Switching from pad %s:%s", GST_DEBUG_PAD_NAME (qtmux->current_pad->collect.pad));