From a8dbe9514f865f6a8efb304a720025cb1ef9ae3f Mon Sep 17 00:00:00 2001 From: Philip Gladstone Date: Fri, 24 May 2002 02:09:40 +0000 Subject: [PATCH] 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 --- libav/utils.c | 12 ++++++------ 1 file 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); }