qtmux: compress/optimize stsc writing

This commit is contained in:
Mark Nauwelaerts 2009-06-10 13:24:20 +02:00
parent 1aeb7d9b54
commit d4b5c6ae5b

View file

@ -2245,6 +2245,10 @@ stsc_entry_new (guint32 first_chunk, guint32 samples, guint32 desc_index)
static void
atom_stsc_add_new_entry (AtomSTSC * stsc, guint32 first_chunk, guint32 nsamples)
{
if (stsc->entries &&
((STSCEntry *) stsc->entries->data)->samples_per_chunk == nsamples)
return;
stsc->entries =
g_list_prepend (stsc->entries, stsc_entry_new (first_chunk, nsamples, 1));
stsc->n_entries++;