mirror of https://git.ffmpeg.org/ffmpeg.git
lavf/utils: use av_{i/o}format_next() instead of first_{i/o}format
Originally committed as revision 25738 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
4fcbb2af33
commit
273231466c
|
@ -206,7 +206,7 @@ AVOutputFormat *guess_format(const char *short_name, const char *filename,
|
||||||
AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
||||||
const char *mime_type)
|
const char *mime_type)
|
||||||
{
|
{
|
||||||
AVOutputFormat *fmt, *fmt_found;
|
AVOutputFormat *fmt = NULL, *fmt_found;
|
||||||
int score_max, score;
|
int score_max, score;
|
||||||
|
|
||||||
/* specific test for image sequences */
|
/* specific test for image sequences */
|
||||||
|
@ -220,8 +220,7 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
||||||
/* Find the proper file type. */
|
/* Find the proper file type. */
|
||||||
fmt_found = NULL;
|
fmt_found = NULL;
|
||||||
score_max = 0;
|
score_max = 0;
|
||||||
fmt = first_oformat;
|
while ((fmt = av_oformat_next(fmt))) {
|
||||||
while (fmt != NULL) {
|
|
||||||
score = 0;
|
score = 0;
|
||||||
if (fmt->name && short_name && !strcmp(fmt->name, short_name))
|
if (fmt->name && short_name && !strcmp(fmt->name, short_name))
|
||||||
score += 100;
|
score += 100;
|
||||||
|
@ -235,7 +234,6 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
||||||
score_max = score;
|
score_max = score;
|
||||||
fmt_found = fmt;
|
fmt_found = fmt;
|
||||||
}
|
}
|
||||||
fmt = fmt->next;
|
|
||||||
}
|
}
|
||||||
return fmt_found;
|
return fmt_found;
|
||||||
}
|
}
|
||||||
|
@ -282,8 +280,8 @@ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
|
||||||
|
|
||||||
AVInputFormat *av_find_input_format(const char *short_name)
|
AVInputFormat *av_find_input_format(const char *short_name)
|
||||||
{
|
{
|
||||||
AVInputFormat *fmt;
|
AVInputFormat *fmt = NULL;
|
||||||
for(fmt = first_iformat; fmt != NULL; fmt = fmt->next) {
|
while ((fmt = av_iformat_next(fmt))) {
|
||||||
if (match_format(short_name, fmt->name))
|
if (match_format(short_name, fmt->name))
|
||||||
return fmt;
|
return fmt;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +349,7 @@ int av_filename_number_test(const char *filename)
|
||||||
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
|
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
|
||||||
{
|
{
|
||||||
AVProbeData lpd = *pd;
|
AVProbeData lpd = *pd;
|
||||||
AVInputFormat *fmt1, *fmt;
|
AVInputFormat *fmt1 = NULL, *fmt;
|
||||||
int score;
|
int score;
|
||||||
|
|
||||||
if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
|
if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
|
||||||
|
@ -363,7 +361,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt = NULL;
|
fmt = NULL;
|
||||||
for(fmt1 = first_iformat; fmt1 != NULL; fmt1 = fmt1->next) {
|
while ((fmt1 = av_iformat_next(fmt1))) {
|
||||||
if (!is_opened == !(fmt1->flags & AVFMT_NOFILE))
|
if (!is_opened == !(fmt1->flags & AVFMT_NOFILE))
|
||||||
continue;
|
continue;
|
||||||
score = 0;
|
score = 0;
|
||||||
|
|
Loading…
Reference in New Issue