qtmux: Fix ctts generation for streams that don't start at 0 timestamps
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Fri, 9 Sep 2011 12:12:56 +0000 (09:12 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 12 Sep 2011 10:37:10 +0000 (07:37 -0300)
commit261d11a6d7392f9231a4f32193d845ec26246581
tree24bb37458ebd3f0459b1d7fed6614700f64b9c25
parentaea09188dca1730c9d97063a522b334c360d3c08
qtmux: Fix ctts generation for streams that don't start at 0 timestamps

Subtract the first timestamp of a stream from all input buffers to
get 0-based timestamps for creating a sane ctts table. Without this
patch the ctts could have larger values than needed, causing the
playback to have a delay at startup.

As the first timestamp is only found after a few buffers are queued
(due to possible reordered buffers), once we find the first timestamp
we subtract it from all buffers on the queue, from that point on,
all buffers have their timestamps subtract when they are collected.

https://bugzilla.gnome.org/show_bug.cgi?id=658659
gst/isomp4/gstqtmux.c