mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 09:41:07 +00:00
matroskamux: Simplify timestamp comparison logic in find_best_pad()
If a buffer has no timestamp it is immediately muxed so we can directly break the loop and simplify comparisons in the other cases. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7872>
This commit is contained in:
parent
a391728ad4
commit
2bbf095e5b
1 changed files with 5 additions and 2 deletions
|
@ -4215,8 +4215,11 @@ gst_matroska_mux_find_best_pad (GstMatroskaMux * mux, GstClockTime * best_time,
|
||||||
gst_matroska_track_get_buffer_timestamp (mux_pad->track, buffer);
|
gst_matroska_track_get_buffer_timestamp (mux_pad->track, buffer);
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
// GST_CLOCK_TIME_NONE < any other clock time
|
// GST_CLOCK_TIME_NONE < any other clock time
|
||||||
if (best == NULL || !GST_CLOCK_TIME_IS_VALID (timestamp) || (best != NULL
|
if (!GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
&& GST_CLOCK_TIME_IS_VALID (best_ts) && timestamp < best_ts)) {
|
best = mux_pad;
|
||||||
|
best_ts = timestamp;
|
||||||
|
break;
|
||||||
|
} else if (best == NULL || timestamp < best_ts) {
|
||||||
best = mux_pad;
|
best = mux_pad;
|
||||||
best_ts = timestamp;
|
best_ts = timestamp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue