h265decoder: Fix for latency report when src caps is not configured

Depending on subclass, negotiation might not happen on new_sequence()

Fixing regression introduced by the commit
4a4823b972

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4383>
This commit is contained in:
Seungha Yang 2023-04-06 19:40:12 +09:00 committed by GStreamer Marge Bot
parent 8f8a0800b9
commit 270ca09961

View file

@ -363,9 +363,10 @@ gst_h265_decoder_set_latency (GstH265Decoder * self, const GstH265SPS * sps,
guint frames_delay; guint frames_delay;
caps = gst_pad_get_current_caps (GST_VIDEO_DECODER_SRC_PAD (self)); caps = gst_pad_get_current_caps (GST_VIDEO_DECODER_SRC_PAD (self));
if (!caps) if (!caps && self->input_state)
return; caps = gst_caps_ref (self->input_state->caps);
if (caps) {
structure = gst_caps_get_structure (caps, 0); structure = gst_caps_get_structure (caps, 0);
if (gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d)) { if (gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d)) {
if (fps_n == 0) { if (fps_n == 0) {
@ -374,6 +375,7 @@ gst_h265_decoder_set_latency (GstH265Decoder * self, const GstH265SPS * sps,
} }
} }
gst_caps_unref (caps); gst_caps_unref (caps);
}
/* if no fps or variable, then 25/1 */ /* if no fps or variable, then 25/1 */
if (fps_n == 0) { if (fps_n == 0) {