diff options
author | Arwed v. Merkatz <v.merkatz@gmx.net> | 2005-12-12 18:14:58 +0000 |
---|---|---|
committer | Arwed v. Merkatz <v.merkatz@gmx.net> | 2005-12-12 18:14:58 +0000 |
commit | fe8b19e160c265dd0945de8d5effaa101fa8739f (patch) | |
tree | 7ff6e176d9b79168f6e49d2661f69f0166837159 /gst | |
parent | 40dee5b0da323e7b97c419c22068f379c276420e (diff) |
Set correct timestamps on audio laces, fixes playback of mp3 from matroska.
Original commit message from CVS:
Set correct timestamps on audio laces, fixes playback of mp3 from matroska.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/matroska/matroska-demux.c | 22 |
1 files changed, 15 insertions, 7 deletions
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; } } |