From efd155c4d93735757f293bb993eca332f4160f4e Mon Sep 17 00:00:00 2001 From: Marc Leeman Date: Thu, 8 Aug 2019 18:47:05 +0000 Subject: [PATCH] rtp: do not overrule RtpInfo when non dynamic type When looking up the Rtp information, do not overwrite information already found with encoding-name by static information. --- gst/rtp/gstrtpsrc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gst/rtp/gstrtpsrc.c b/gst/rtp/gstrtpsrc.c index 844146d694..cd86bce487 100644 --- a/gst/rtp/gstrtpsrc.c +++ b/gst/rtp/gstrtpsrc.c @@ -123,9 +123,14 @@ gst_rtp_src_rtpbin_request_pt_map_cb (GstElement * rtpbin, guint session_id, } - /* Static payload types, this is a simple lookup */ - if (!GST_RTP_PAYLOAD_IS_DYNAMIC (pt)) { - p = gst_rtp_payload_info_for_pt (pt); + /* If info has been found before based on the encoding-name, go with + * it. If not, try to look it up on with a static one. Needs to be guarded + * because some encoders do not use dynamic values for H.264 */ + if (p == NULL) { + /* Static payload types, this is a simple lookup */ + if (!GST_RTP_PAYLOAD_IS_DYNAMIC (pt)) { + p = gst_rtp_payload_info_for_pt (pt); + } } if (p != NULL) {