mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 13:14:36 +00:00
av_common: explicitly exclude _vdpau deccoders from enumeration
Completely pointless abominations that FFmpeg refuses to remove. They are ancient, long deprecated API which we can't use anymore. They confused users as well. Pretend that they don't exist. Due to the way --vd works, they can't even be forced anymore. The older hack which explicitly rejects these can be dropped as well.
This commit is contained in:
parent
a888f08b78
commit
fa8b2be4de
@ -144,6 +144,11 @@ void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads
|
||||
avctx->thread_count = threads;
|
||||
}
|
||||
|
||||
static bool is_crap(AVCodec *codec)
|
||||
{
|
||||
return !!strstr(codec->name, "_vdpau");
|
||||
}
|
||||
|
||||
void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type)
|
||||
{
|
||||
AVCodec *cur = NULL;
|
||||
@ -151,7 +156,7 @@ void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type)
|
||||
cur = av_codec_next(cur);
|
||||
if (!cur)
|
||||
break;
|
||||
if (av_codec_is_decoder(cur) && cur->type == type) {
|
||||
if (av_codec_is_decoder(cur) && cur->type == type && !is_crap(cur)) {
|
||||
mp_add_decoder(list, "lavc", mp_codec_from_av_codec_id(cur->id),
|
||||
cur->name, cur->long_name);
|
||||
}
|
||||
|
@ -335,17 +335,6 @@ static int init(struct dec_video *vd, const char *decoder)
|
||||
ctx->opts = vd->opts;
|
||||
ctx->decoder = talloc_strdup(ctx, decoder);
|
||||
|
||||
if (bstr_endswith0(bstr0(decoder), "_vdpau")) {
|
||||
MP_WARN(vd, "VDPAU decoder '%s' was requested. "
|
||||
"This way of enabling hardware\ndecoding is not supported "
|
||||
"anymore. Use --hwdec=vdpau instead.\nThe --hwdec-codec=... "
|
||||
"option can be used to restrict which codecs are\nenabled, "
|
||||
"otherwise all hardware decoding is tried for all codecs.\n",
|
||||
decoder);
|
||||
uninit(vd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
reinit(vd);
|
||||
|
||||
if (!ctx->avctx) {
|
||||
|
Loading…
Reference in New Issue
Block a user