Commit a8dbe951 authored by Philip Gladstone's avatar Philip Gladstone

Change order of extensions and read_probe checking. This gives the read_probe

a higher priority than extensions. This gives FFM a chance of working. Note
that some of the other probe functions are bit optimistic, and can be
confused by binary data (such as 0x00 0x00 0x01 0xzz) for some values of zz.

This set of changes makes ffserver work again, and fixes the cannot open
video grab device message.

Originally committed as revision 581 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 07c4ed85
......@@ -329,13 +329,13 @@ static AVInputFormat *probe_input_format(AVProbeData *pd, int is_opened)
if (!is_opened && !(fmt1->flags & AVFMT_NOFILE))
continue;
score = 0;
if (fmt1->extensions) {
if (fmt1->read_probe) {
score = fmt1->read_probe(pd);
} else if (fmt1->extensions) {
if (match_ext(pd->filename, fmt1->extensions)) {
score = 50;
}
} else if (fmt1->read_probe) {
score = fmt1->read_probe(pd);
}
}
if (score > score_max) {
score_max = score;
fmt = fmt1;
......@@ -438,7 +438,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
}
fail:
if (ic) {
av_free(ic->priv_data);
av_freep(&ic->priv_data);
}
av_free(ic);
*ic_ptr = NULL;
......@@ -714,7 +714,7 @@ void av_close_input_file(AVFormatContext *s)
if (!(s->iformat->flags & AVFMT_NOFILE)) {
url_fclose(&s->pb);
}
av_free(s->priv_data);
av_freep(&s->priv_data);
av_free(s);
}
......
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