matroskamux: correctly handle negative relative timestamps
... rather than scaling these as unsigned. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712744 Based on patch by Krzysztof Kotlenga <pocek@users.sf.net>
This commit is contained in:
parent
83f8ee1d41
commit
643e6fdc36
@ -3381,12 +3381,15 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad,
|
|||||||
if (relative_timestamp64 >= 0) {
|
if (relative_timestamp64 >= 0) {
|
||||||
/* round the timestamp */
|
/* round the timestamp */
|
||||||
relative_timestamp64 += gst_util_uint64_scale (mux->time_scale, 1, 2);
|
relative_timestamp64 += gst_util_uint64_scale (mux->time_scale, 1, 2);
|
||||||
|
relative_timestamp = gst_util_uint64_scale (relative_timestamp64, 1,
|
||||||
|
mux->time_scale);
|
||||||
} else {
|
} else {
|
||||||
/* round the timestamp */
|
/* round the timestamp */
|
||||||
relative_timestamp64 -= gst_util_uint64_scale (mux->time_scale, 1, 2);
|
relative_timestamp64 -= gst_util_uint64_scale (mux->time_scale, 1, 2);
|
||||||
|
relative_timestamp =
|
||||||
|
-((gint16) gst_util_uint64_scale (-relative_timestamp64, 1,
|
||||||
|
mux->time_scale));
|
||||||
}
|
}
|
||||||
relative_timestamp = gst_util_uint64_scale (relative_timestamp64, 1,
|
|
||||||
mux->time_scale);
|
|
||||||
|
|
||||||
if (is_video_invisible)
|
if (is_video_invisible)
|
||||||
flags |= 0x08;
|
flags |= 0x08;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user