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
ebml-write.c matroskamux: Use nanosecond precision for DateUTC 2019-11-22 16:30:50 +01:00
ebml-write.h
lzo.c
lzo.h
matroska-demux.c
matroska-demux.h
matroska-ids.c
matroska-ids.h
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
matroska-parse.h
matroska-read-common.c matroskamux: Add property to set DateUTC 2019-11-25 14:01:48 +01:00
matroska-read-common.h
matroska.c
meson.build
webm-mux.c
webm-mux.h