summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2009-11-24 16:16:56 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2009-11-25 21:37:17 -0300
commit379931cc6eaba787dea2ad768e67ec7e39a6d7c2 (patch)
tree676f1548888118e3fb678b87a80ef9b5ccd0ea0b /gst
parent990166d1d3a09ea43d7366385cde687c506d5a51 (diff)
qtmux: use timestamps for muxing
Try to use timestamps even when the stream has out of order timestamps, only fall back to durations when we detect an out of order buffer. Improves sync between streams.
Diffstat (limited to 'gst')
-rw-r--r--gst/qtmux/gstqtmux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c
index c5a818e09..f7aeeb50e 100644
--- a/gst/qtmux/gstqtmux.c
+++ b/gst/qtmux/gstqtmux.c
@@ -1304,11 +1304,12 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
/* fall back to duration if:
* - last bufer
- * - this format has out of order buffers (e.g. MPEG-4),
+ * - the buffers are out of order,
* - lack of valid time forces fall back */
- if (buf == NULL || pad->is_out_of_order ||
+ if (buf == NULL ||
!GST_BUFFER_TIMESTAMP_IS_VALID (last_buf) ||
- !GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
+ !GST_BUFFER_TIMESTAMP_IS_VALID (buf) ||
+ GST_BUFFER_TIMESTAMP (buf) < GST_BUFFER_TIMESTAMP (last_buf)) {
if (!GST_BUFFER_DURATION_IS_VALID (last_buf)) {
/* be forgiving for some possibly last upstream flushed buffer */
if (buf)