mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
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.
This commit is contained in:
parent
40dee5b0da
commit
fe8b19e160
2 changed files with 22 additions and 7 deletions
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue