Skip to content
Snippets Groups Projects
Commit cb1fdc61 authored by Fabrice Bellard's avatar Fabrice Bellard
Browse files

match SDP based on content instead of extension

Originally committed as revision 1255 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5d3cea3a
No related branches found
No related tags found
No related merge requests found
...@@ -984,12 +984,22 @@ static AVInputFormat rtsp_demux = { ...@@ -984,12 +984,22 @@ static AVInputFormat rtsp_demux = {
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
}; };
static int sdp_probe(AVProbeData *p1)
/* XXX: add mime type support */
static int sdp_probe(AVProbeData *p)
{ {
if (match_ext(p->filename, "sdp")) const char *p;
return AVPROBE_SCORE_MAX;
/* we look for a line beginning "c=IN IP4" */
p = p1->buf;
while (*p != '\0') {
if (strstart(p, "c=IN IP4", NULL))
return AVPROBE_SCORE_MAX / 2;
p = strchr(p, '\n');
if (!p)
break;
p++;
if (*p == '\r')
p++;
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment