qtmux: for fixed-sample size streams (PCM audio, etc) don't allocate an enormous
authorMichael Smith <msmith@songbirdnest.com>
Thu, 28 Jan 2010 03:06:53 +0000 (19:06 -0800)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 12 Apr 2011 19:32:15 +0000 (20:32 +0100)
buffer that we then won't use at all.

gst/quicktime/atoms.c

index 67cf2a0..d625823 100644 (file)
@@ -1742,9 +1742,9 @@ atom_stsz_copy_data (AtomSTSZ * stsz, guint8 ** buffer, guint64 * size,
 
   prop_copy_uint32 (stsz->sample_size, buffer, size, offset);
   prop_copy_uint32 (stsz->table_size, buffer, size, offset);
-  /* minimize realloc */
-  prop_copy_ensure_buffer (buffer, size, offset, 4 * stsz->table_size);
   if (stsz->sample_size == 0) {
+    /* minimize realloc */
+    prop_copy_ensure_buffer (buffer, size, offset, 4 * stsz->table_size);
     /* entry count must match sample count */
     g_assert (atom_array_get_len (&stsz->entries) == stsz->table_size);
     for (i = 0; i < atom_array_get_len (&stsz->entries); i++) {