Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vd_lavc: don't hardware decode vc1 by default #15733

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ Video
You can get the list of allowed codecs with ``mpv --vd=help``. Remove the
prefix, e.g. instead of ``lavc:h264`` use ``h264``.

By default, this is set to ``h264,vc1,hevc,vp8,vp9,av1,prores``. Note that
By default, this is set to ``h264,hevc,vp8,vp9,av1,prores``. Note that
the hardware acceleration special codecs like ``h264_vdpau`` are not
relevant anymore, and in fact have been removed from FFmpeg in this form.

Expand Down
9 changes: 6 additions & 3 deletions video/decode/vd_lavc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static int hwdec_opt_help(struct mp_log *log, const m_option_t *opt,
struct bstr name);

#define HWDEC_DELAY_QUEUE_COUNT 2
#define HWDEC_DEFAULT_CODECS "h264,hevc,vp8,vp9,av1,prores"

#define OPT_BASE_STRUCT struct vd_lavc_params

Expand Down Expand Up @@ -140,7 +141,7 @@ const struct m_sub_options vd_lavc_conf = {
.framedrop = AVDISCARD_NONREF,
.dr = -1,
.hwdec_api = (char *[]){"no", NULL,},
.hwdec_codecs = "h264,vc1,hevc,vp8,vp9,av1,prores",
.hwdec_codecs = HWDEC_DEFAULT_CODECS,
// Maximum number of surfaces the player wants to buffer. This number
// might require adjustment depending on whatever the player does;
// for example, if vo_gpu increases the number of reference surfaces for
Expand Down Expand Up @@ -497,8 +498,10 @@ static void select_and_set_hwdec(struct mp_filter *vd)
MP_VERBOSE(vd, "No hardware decoding requested.\n");
break;
} else if (!hwdec_codec_allowed(vd, codec)) {
MP_VERBOSE(vd, "Not trying to use hardware decoding: codec %s is not "
"on whitelist.\n", codec);
bool default_codecs = !strcmp(ctx->opts->hwdec_codecs, HWDEC_DEFAULT_CODECS);
MP_MSG(vd, default_codecs ? MSGL_INFO : MSGL_V,
"Not trying to use hardware decoding: codec %s is not "
"in the --hwdec-codecs whitelist.\n", codec);
break;
} else {
bool hwdec_name_supported = false; // relevant only if !hwdec_auto
Expand Down
Loading