From d6c5fbc87c989ff4eb574a49aa12104f7afa4a80 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Mar 2014 11:12:51 +0100 Subject: [PATCH] rtspsrc: handle NULL rtpmap and parse error better --- gst/rtsp/gstrtspsrc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 41c494014e..8455ffe40f 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1769,15 +1769,17 @@ gst_rtspsrc_media_to_caps (gint pt, const GstSDPMedia * media) /* get and parse rtpmap */ rtpmap = rtsp_get_attribute_for_pt (media, "rtpmap", pt); + if (rtpmap) { + ret = gst_rtspsrc_parse_rtpmap (rtpmap, &payload, &name, &rate, ¶ms); + if (!ret) { + g_warning ("error parsing rtpmap, ignoring"); + rtpmap = NULL; + } + } /* dynamic payloads need rtpmap or we fail */ if (rtpmap == NULL && pt >= 96) goto no_rtpmap; - ret = gst_rtspsrc_parse_rtpmap (rtpmap, &payload, &name, &rate, ¶ms); - if (!ret) { - g_warning ("error parsing rtpmap, ignoring"); - } - /* check if we have a rate, if not, we need to look up the rate from the * default rates based on the payload types. */ if (rate == -1) { -- 2.34.1