mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
matroskamux: Clip maximum cluster duration to the maximum possible value
Only up to timescale * G_MAXINT16 is possible as cluster duration, which is already higher than our default value. Using higher values would cause overflows and broken files. Based on the investigation by Nicola Murino <nicola.murino@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=792775
This commit is contained in:
parent
fc37bf70c5
commit
15ae79838c
1 changed files with 2 additions and 1 deletions
|
@ -3725,7 +3725,8 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad,
|
|||
mux->min_cluster_duration));
|
||||
is_max_duration_exceeded = (mux->max_cluster_duration > 0
|
||||
&& buffer_timestamp > mux->cluster_time
|
||||
&& (buffer_timestamp - mux->cluster_time) >= mux->max_cluster_duration);
|
||||
&& (buffer_timestamp - mux->cluster_time) >=
|
||||
MIN (G_MAXINT16 * mux->time_scale, mux->max_cluster_duration));
|
||||
|
||||
if (mux->cluster) {
|
||||
/* start a new cluster at every keyframe, at every GstForceKeyUnit event,
|
||||
|
|
Loading…
Reference in a new issue