Use RTPDynamicProtocol parse_sdp_a_line() handlers in case of unknown SDP
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 27 Aug 2008 00:33:22 +0000 (00:33 +0000)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 27 Aug 2008 00:33:22 +0000 (00:33 +0000)
lines. This allows "private" SDP tags to be forwarded to the specific handler,
allowing protocol-specific handling of SDP data. See mailinglist discussion
in the "Realmedia patch" thread.

Originally committed as revision 14987 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rtsp.c

index a3af365..88d15c3 100644 (file)
@@ -527,6 +527,12 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
             rtsp_parse_range_npt(p, &start, &end);
             s->start_time= start;
             s->duration= (end==AV_NOPTS_VALUE)?AV_NOPTS_VALUE:end-start; // AV_NOPTS_VALUE means live broadcast (and can't seek)
             rtsp_parse_range_npt(p, &start, &end);
             s->start_time= start;
             s->duration= (end==AV_NOPTS_VALUE)?AV_NOPTS_VALUE:end-start; // AV_NOPTS_VALUE means live broadcast (and can't seek)
+        } else if (s->nb_streams > 0) {
+            rtsp_st = s->streams[s->nb_streams - 1]->priv_data;
+            if (rtsp_st->dynamic_handler &&
+                rtsp_st->dynamic_handler->parse_sdp_a_line)
+                rtsp_st->dynamic_handler->parse_sdp_a_line(s->streams[s->nb_streams - 1],
+                    rtsp_st->dynamic_protocol_context, buf);
         }
         break;
     }
         }
         break;
     }