mirror of https://git.ffmpeg.org/ffmpeg.git
Revert "avformat/format: temporarily use old next api"
This reverts commit 909e00ae81
.
There is no need to use the old API anymore as the new API now
behaves in the same way (treating devices as formats when loaded).
Signed-off-by: Josh de Kock <josh@itanimul.li>
This commit is contained in:
parent
f1805d160d
commit
85bf89885a
|
@ -51,10 +51,9 @@ int av_match_ext(const char *filename, const char *extensions)
|
||||||
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 = NULL, *fmt_found;
|
const AVOutputFormat *fmt = NULL;
|
||||||
#if !FF_API_NEXT
|
AVOutputFormat *fmt_found = NULL;
|
||||||
void *i = 0;
|
void *i = 0;
|
||||||
#endif
|
|
||||||
int score_max, score;
|
int score_max, score;
|
||||||
|
|
||||||
/* specific test for image sequences */
|
/* specific test for image sequences */
|
||||||
|
@ -66,15 +65,8 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Find the proper file type. */
|
/* Find the proper file type. */
|
||||||
fmt_found = NULL;
|
|
||||||
score_max = 0;
|
score_max = 0;
|
||||||
#if FF_API_NEXT
|
while ((fmt = av_muxer_iterate(&i))) {
|
||||||
FF_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
while ((fmt = av_oformat_next(fmt)))
|
|
||||||
#else
|
|
||||||
while ((fmt = av_muxer_iterate(&i)))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
score = 0;
|
score = 0;
|
||||||
if (fmt->name && short_name && av_match_name(short_name, fmt->name))
|
if (fmt->name && short_name && av_match_name(short_name, fmt->name))
|
||||||
score += 100;
|
score += 100;
|
||||||
|
@ -86,12 +78,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
}
|
}
|
||||||
if (score > score_max) {
|
if (score > score_max) {
|
||||||
score_max = score;
|
score_max = score;
|
||||||
fmt_found = fmt;
|
fmt_found = (AVOutputFormat*)fmt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if FF_API_NEXT
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
return fmt_found;
|
return fmt_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue