mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
h265parse: Don't add latency when not needed
We no longer add latency when doing AU->AU, AU->NAL and NAL->NAL parsing.
This commit is contained in:
parent
ceb68c4cf8
commit
1aede43af6
1 changed files with 11 additions and 3 deletions
|
@ -2065,7 +2065,7 @@ gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps)
|
|||
gint fps_num = h265parse->fps_num;
|
||||
gint fps_den = h265parse->fps_den;
|
||||
gint width, height;
|
||||
GstClockTime latency;
|
||||
GstClockTime latency = 0;
|
||||
|
||||
caps = gst_caps_copy (sink_caps);
|
||||
|
||||
|
@ -2088,7 +2088,7 @@ gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps)
|
|||
gst_structure_get_fraction (s, "framerate", &fps_num, &fps_den);
|
||||
|
||||
/* but not necessarily or reliably this */
|
||||
if (fps_num > 0 && fps_den > 0) {
|
||||
if (fps_den > 0) {
|
||||
GstStructure *s2;
|
||||
GstClockTime val;
|
||||
|
||||
|
@ -2102,7 +2102,15 @@ gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps)
|
|||
fps_num, fps_den, 0, 0);
|
||||
val = sps->profile_tier_level.interlaced_source_flag ? GST_SECOND / 2 :
|
||||
GST_SECOND;
|
||||
|
||||
/* If we know the frame duration, and if we are not in one of the zero
|
||||
* latency pattern, add one frame of latency */
|
||||
if (fps_num > 0 &&
|
||||
h265parse->in_align != GST_H265_PARSE_ALIGN_AU &&
|
||||
!(h265parse->in_align == GST_H265_PARSE_ALIGN_NAL &&
|
||||
h265parse->align == GST_H265_PARSE_ALIGN_NAL))
|
||||
latency = gst_util_uint64_scale (val, fps_den, fps_num);
|
||||
|
||||
gst_base_parse_set_latency (GST_BASE_PARSE (h265parse), latency,
|
||||
latency);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue