Commit 5b9a750f authored by bellard's avatar bellard

match SDP based on content instead of extension


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1255 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c116e70d
......@@ -984,12 +984,22 @@ static AVInputFormat rtsp_demux = {
.flags = AVFMT_NOFILE,
};
/* XXX: add mime type support */
static int sdp_probe(AVProbeData *p)
static int sdp_probe(AVProbeData *p1)
{
if (match_ext(p->filename, "sdp"))
return AVPROBE_SCORE_MAX;
const char *p;
/* 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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment