gstreamer/gst/matroska
Johan Bjäreholt ce802f033c matroska-mux: Fix incorrect rounding of timestamps
Previously we saved the buffer_timestamp straight into
mux->cluster_time. Since the cluster time saved into the file does not
have as high precision as GstClockTime depending on the timecodescale
the rounding of relative_timestamp was invalid as mux->cluster_time
which it was calculated relative to was not equal to the cluster time
written to the matroska file.

Example of "mkvinfo -v" of how it looks before and after this change in
an scenario where previously timestamps got out of order because of this
issue.

Notice the timestamp of the SimpleBlock right before and right after the
Cluster now being in order. The consequence of this however is that the
cluster timestamp is not necessarily the same as the timestamp of the
first buffer in the cluster however (in case it's rounded up).

Before

| + SimpleBlock (track number 1, 1 frame(s), timecode 126.922s = 00:02:06.922)
|  + Frame with size 432
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.933s = 00:02:06.933)
|  + Frame with size 329
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.955s = 00:02:06.955)
|  + Frame with size 333
|+ Cluster
| + Cluster timecode: 126.954s
| + Cluster previous size: 97344
| + SimpleBlock (key, track number 1, 1 frame(s), timecode 126.954s = 00:02:06.954)
|  + Frame with size 61239
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.975s = 00:02:06.975)
|  + Frame with size 338

After

| + SimpleBlock (track number 1, 1 frame(s), timecode 135.456s = 00:02:15.456)
|  + Frame with size 2260
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.468s = 00:02:15.468)
|  + Frame with size 332
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.490s = 00:02:15.490)
|  + Frame with size 335
|+ Cluster
| + Cluster timecode: 135.489s
| + Cluster previous size: 158758
| + SimpleBlock (key, track number 1, 1 frame(s), timecode 135.490s = 00:02:15.490)
|  + Frame with size 88070
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.511s = 00:02:15.511)
|  + Frame with size 336
2020-02-21 12:49:28 +00:00
..
ebml-ids.h matroskamux: Use nanosecond precision for DateUTC 2019-11-22 16:30:50 +01:00
ebml-read.c matroskamux: Use nanosecond precision for DateUTC 2019-11-22 16:30:50 +01:00
ebml-read.h Fix FSF address 2012-11-04 00:07:18 +00:00
ebml-write.c matroskamux: Use nanosecond precision for DateUTC 2019-11-22 16:30:50 +01:00
ebml-write.h matroska: Remove white space 2019-05-01 14:28:36 +00:00
lzo.c matroska: get rid of _stdint.h include 2016-02-08 00:11:55 +00:00
lzo.h Decode the codec private data and following ContentEncoding if necessary. 2008-08-02 18:18:05 +00:00
matroska-demux.c documentation: fix a number of typos 2019-10-05 22:38:11 +00:00
matroska-demux.h matroska: Provide audio lead-in for some lossy formats 2019-08-07 18:51:57 -04:00
matroska-ids.c matroska: Handle interlaced field order 2019-08-07 14:12:32 +00:00
matroska-ids.h matroska: Handle interlaced field order 2019-08-07 14:12:32 +00:00
matroska-mux.c matroska-mux: Fix incorrect rounding of timestamps 2020-02-21 12:49:28 +00:00
matroska-mux.h matroskamux: Add property to set DateUTC 2019-11-25 14:01:48 +01:00
matroska-parse.c documentation: fix a number of typos 2019-10-05 22:38:11 +00:00
matroska-parse.h matroska: Remove unused variable 2015-08-13 14:11:12 +01:00
matroska-read-common.c matroskamux: Add property to set DateUTC 2019-11-25 14:01:48 +01:00
matroska-read-common.h matroska: Remove white space 2019-05-01 14:28:36 +00:00
matroska.c Fix FSF address 2012-11-04 00:07:18 +00:00
meson.build doc: Port documentation to hotdoc 2019-05-13 11:34:56 -04:00
webm-mux.c docs: Port all docstring to gtk-doc markdown 2019-05-13 10:24:40 -04:00
webm-mux.h Fix FSF address 2012-11-04 00:07:18 +00:00