diff options
author | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-05-24 02:09:40 +0000 |
---|---|---|
committer | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-05-24 02:09:40 +0000 |
commit | a8dbe9514f865f6a8efb304a720025cb1ef9ae3f (patch) | |
tree | 40200e9a48964a1f6af93f7815e23d2ce7589cad | |
parent | 07c4ed85f765a469cf2913264d158cc6129e5de1 (diff) | |
download | ffmpeg-a8dbe9514f865f6a8efb304a720025cb1ef9ae3f.tar.gz |
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
-rw-r--r-- | libav/utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libav/utils.c b/libav/utils.c index ef5a3c709c..7bc2a5de91 100644 --- a/libav/utils.c +++ b/libav/utils.c @@ -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); } |