aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2018-05-16 20:54:46 +0200
committerGravatar sfan5 <sfan5@live.de>2018-05-25 10:17:06 +0200
commit25525cee62cdf863b1b7db768e7d594a20df21c7 (patch)
tree708f639945dab056e9c87082015a5ecbffdc5c10 /video
parent3101cb3847355b32c2efbf644f5cb16a2b4feff8 (diff)
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')
-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);