summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-02 22:20:04 +0100
committerwm4 <wm4@nowhere>2016-03-02 22:20:15 +0100
commitfa8b2be4de852a3fc0ef340543a1f6737d611435 (patch)
treee18b8601e57017a920af51d6d70c6706af22d64f /common
parenta888f08b78e9b3bc1ce59fbfcd1e4b4eafb23245 (diff)
downloadmpv-fa8b2be4de852a3fc0ef340543a1f6737d611435.tar.bz2
mpv-fa8b2be4de852a3fc0ef340543a1f6737d611435.tar.xz
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.
Diffstat (limited to 'common')
-rw-r--r--common/av_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/av_common.c b/common/av_common.c
index 5cb434f969..6efa1803fd 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -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);
}