summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-16 20:54:46 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commitc9fcd20959ef8d0463be0599e8596002ae68ffd2 (patch)
treeff3ef19eb4db13a2ea03697cedd63c652195d09e /video/decode
parent5f61892c42b78d271bcc3f027fb8097a83b32231 (diff)
downloadmpv-c9fcd20959ef8d0463be0599e8596002ae68ffd2.tar.bz2
mpv-c9fcd20959ef8d0463be0599e8596002ae68ffd2.tar.xz
vd_lavc: minor simplification for get_format fallback
The default get_format does exactly do this, so we don't need to duplicate it. The only potential problem with this is that the logic doesn't entirely prevent that the avcodec_default_get_format hw_device_ctx path is triggered, which would probably work, but has unknown consequences and interactions. But the way the logic currently works it can't happen, provided the hwaccel metadata libavcodec provides is correct.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index a2f1d7d494..25049aa341 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -818,13 +818,7 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,
if (select == AV_PIX_FMT_NONE) {
ctx->hwdec_failed = true;
- for (int i = 0; fmt[i] != AV_PIX_FMT_NONE; i++) {
- const AVPixFmtDescriptor *d = av_pix_fmt_desc_get(fmt[i]);
- if (d && !(d->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
- select = fmt[i];
- break;
- }
- }
+ select = avcodec_default_get_format(avctx, fmt);
}
const char *name = av_get_pix_fmt_name(select);