Commit 5633f9a8 authored by Jun Zhao's avatar Jun Zhao

fftools: fix hwaccels option dump redundancy

When QSV is enabled in FFmpeg, the command "ffmpeg -hwaccels" shows a
duplicate entry in acceleration methods for QSV:

Hardware acceleration methods:
vaapi
qsv
drm
opencl
qsv
Reviewed-by: 's avatarMark Thompson <sw@jkqxz.net>
Signed-off-by: 's avatarJun Zhao <barryjzhao@tencent.com>
parent f0d712d0
...@@ -233,14 +233,11 @@ static void init_options(OptionsContext *o) ...@@ -233,14 +233,11 @@ static void init_options(OptionsContext *o)
static int show_hwaccels(void *optctx, const char *opt, const char *arg) static int show_hwaccels(void *optctx, const char *opt, const char *arg)
{ {
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE; enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
int i;
printf("Hardware acceleration methods:\n"); printf("Hardware acceleration methods:\n");
while ((type = av_hwdevice_iterate_types(type)) != while ((type = av_hwdevice_iterate_types(type)) !=
AV_HWDEVICE_TYPE_NONE) AV_HWDEVICE_TYPE_NONE)
printf("%s\n", av_hwdevice_get_type_name(type)); printf("%s\n", av_hwdevice_get_type_name(type));
for (i = 0; hwaccels[i].name; i++)
printf("%s\n", hwaccels[i].name);
printf("\n"); printf("\n");
return 0; return 0;
} }
...@@ -936,8 +933,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) ...@@ -936,8 +933,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
AV_HWDEVICE_TYPE_NONE) AV_HWDEVICE_TYPE_NONE)
av_log(NULL, AV_LOG_FATAL, "%s ", av_log(NULL, AV_LOG_FATAL, "%s ",
av_hwdevice_get_type_name(type)); av_hwdevice_get_type_name(type));
for (i = 0; hwaccels[i].name; i++)
av_log(NULL, AV_LOG_FATAL, "%s ", hwaccels[i].name);
av_log(NULL, AV_LOG_FATAL, "\n"); av_log(NULL, AV_LOG_FATAL, "\n");
exit_program(1); exit_program(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment