summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index de917a7820..bbe6734c19 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -538,7 +538,12 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,
}
ctx->hwdec_failed = true;
- return fmt[0];
+ 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))
+ return fmt[i];
+ }
+ return AV_PIX_FMT_NONE;
}
static void free_mpi(void *opaque, uint8_t *data)