summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-28 18:36:00 +0100
committerwm4 <wm4@nowhere>2017-01-28 18:36:00 +0100
commit0aac7533dc4b7f45ff21c1f1dab9c42c58fef994 (patch)
tree1fd4fe8c414ea83c4554a3d22bd73b73ca15a320
parent443d3a91d335188be15c3bd2616d2cc9c4728566 (diff)
downloadmpv-0aac7533dc4b7f45ff21c1f1dab9c42c58fef994.tar.bz2
mpv-0aac7533dc4b7f45ff21c1f1dab9c42c58fef994.tar.xz
vaapi: improve a comment
Try to actually explain what's up with this code.
-rw-r--r--video/decode/hw_vaapi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/video/decode/hw_vaapi.c b/video/decode/hw_vaapi.c
index 2dba5a99bd..99c23f48c4 100644
--- a/video/decode/hw_vaapi.c
+++ b/video/decode/hw_vaapi.c
@@ -45,7 +45,13 @@ struct priv {
static int init_decoder(struct lavc_ctx *ctx, int w, int h)
{
struct priv *p = ctx->hwdec_priv;
- // From avconv_vaapi.c. Disgusting, but apparently this is the best we get.
+ // libavcodec has no way yet to communicate the exact surface format needed
+ // for the frame pool, or the required minimum size of the frame pool.
+ // Hopefully, this weakness in the libavcodec API will be fixed in the
+ // future.
+ // For the pixel format, we try to second-guess from what the libavcodec
+ // software decoder would require (sw_pix_fmt). It could break and require
+ // adjustment if new VAAPI surface formats are added.
int sw_format = ctx->avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ?
AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;