summaryrefslogtreecommitdiff
path: root/libavformat/format.c
diff options
context:
space:
mode:
authorJosh de Kock <josh@itanimul.li>2018-04-01 00:19:49 +0100
committerJosh de Kock <josh@itanimul.li>2018-04-02 03:26:22 +0100
commit85bf89885a97c18bfaf9dbe30321af9a58a1444d (patch)
tree90a4db50f4a823d49d075154aa8adda668406ea1 /libavformat/format.c
parentf1805d160d66442567094fc84d3063ad42458809 (diff)
Revert "avformat/format: temporarily use old next api"
This reverts commit 909e00ae816df9b6a05b1c4d0cafb794d4d0ca28. 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>
Diffstat (limited to 'libavformat/format.c')
-rw-r--r--libavformat/format.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/libavformat/format.c b/libavformat/format.c
index 123f5faf6c..1b2ce22e25 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -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,
const char *mime_type)
{
- AVOutputFormat *fmt = NULL, *fmt_found;
-#if !FF_API_NEXT
+ const AVOutputFormat *fmt = NULL;
+ AVOutputFormat *fmt_found = NULL;
void *i = 0;
-#endif
int score_max, score;
/* specific test for image sequences */
@@ -66,15 +65,8 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
}
#endif
/* Find the proper file type. */
- fmt_found = NULL;
score_max = 0;
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
- while ((fmt = av_oformat_next(fmt)))
-#else
- while ((fmt = av_muxer_iterate(&i)))
-#endif
- {
+ while ((fmt = av_muxer_iterate(&i))) {
score = 0;
if (fmt->name && short_name && av_match_name(short_name, fmt->name))
score += 100;
@@ -86,12 +78,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
}
if (score > score_max) {
score_max = score;
- fmt_found = fmt;
+ fmt_found = (AVOutputFormat*)fmt;
}
}
-#if FF_API_NEXT
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return fmt_found;
}