summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--gst/matroska/matroska-demux.c22
2 files changed, 22 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ce001a6..d14968ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-12 Arwed v. Merkatz <v.merkatz@gmx.net>
+
+ * gst/matroska/matroska-demux.c:
+ (gst_matroska_demux_parse_blockgroup_or_simpleblock):
+ Set correct timestamps on audio laces, fixes playback of mp3 from
+ matroska.
+
2005-12-12 Tim-Philipp Müller <tim at centricular dot net>
* gst/auparse/gstauparse.c: (gst_au_parse_base_init),
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 188bab19..1f1bef32 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -2101,6 +2101,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
guint size = 0;
gint *lace_size = NULL;
gint64 time = 0;
+ gint64 lace_time = 0;
gint flags = 0;
while (!got_error) {
@@ -2295,6 +2296,15 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
}
}
+ if (cluster_time != GST_CLOCK_TIME_NONE) {
+ if (time < 0 && (-time) > cluster_time)
+ lace_time = cluster_time;
+ else
+ lace_time = cluster_time + time;
+ } else {
+ lace_time = GST_CLOCK_TIME_NONE;
+ }
+
if (!got_error && readblock) {
guint64 duration = 0;
@@ -2316,14 +2326,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
sub = gst_buffer_create_sub (buf,
GST_BUFFER_SIZE (buf) - size, lace_size[n]);
- 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;
+ GST_BUFFER_TIMESTAMP (sub) = lace_time;
+ if (lace_time != GST_CLOCK_TIME_NONE)
+ demux->pos = lace_time;
- demux->pos = GST_BUFFER_TIMESTAMP (sub);
- }
stream->pos = demux->pos;
gst_matroska_demux_sync_streams (demux);
@@ -2358,6 +2364,8 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
got_error = TRUE;
size -= lace_size[n];
+ if (lace_time != GST_CLOCK_TIME_NONE)
+ lace_time += duration;
}
}