summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-12-19 16:07:00 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-12-19 16:07:00 +0000
commit69482984d5b979831fccb90d2644c09755c22c6f (patch)
treea76229830e3ce64d0d2b40df3c800d3d97dc76ca
parent5345dd61ec4f3b56c52c2f7455b33751434891d5 (diff)
Quickfix for wrong timestamps... No final solution yetMOVE-TO-FDO
Original commit message from CVS: Quickfix for wrong timestamps... No final solution yet
-rw-r--r--gst/matroska/matroska-demux.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 371fd18fb..dafb72aa8 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -1652,6 +1652,8 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
/* time (relative to cluster time) */
time = (* (gint16 *) data) * demux->time_scale;
+ /* I think this is mis-documented in the matroska sources, we should
+ * probably shift values (EBML-style) on this value... */
time = GINT16_FROM_BE (time);
data += 2; size -= 2;
flags = * (guint8 *) data;
@@ -1734,9 +1736,12 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
GST_BUFFER_SIZE (buf) - size,
lace_size[n]);
- if (cluster_time != GST_CLOCK_TIME_NONE)
- GST_BUFFER_TIMESTAMP (sub) = cluster_time + time;
-
+ if (cluster_time != GST_CLOCK_TIME_NONE) {
+ if (time < 0 && (-time) > cluster_time)
+ GST_BUFFER_TIMESTAMP (sub) = cluster_time;
+ else
+ GST_BUFFER_TIMESTAMP (sub) = cluster_time + time;
+ }
/* FIXME: duration */
gst_pad_push (demux->src[stream]->pad, GST_DATA (sub));