From 5f449fc11f005b926b76106b3dd7fa6cdede232f Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Jan 2017 15:55:45 +0100 Subject: video: share hwdec extra surface count between backends It's a quite important and fragile magic number. --- video/decode/d3d11va.c | 2 +- video/decode/dxva2.c | 2 +- video/decode/lavc.h | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/video/decode/d3d11va.c b/video/decode/d3d11va.c index e31582d37c..a69a3890bd 100644 --- a/video/decode/d3d11va.c +++ b/video/decode/d3d11va.c @@ -27,7 +27,7 @@ #include "d3d.h" -#define ADDITIONAL_SURFACES (4 + HWDEC_DELAY_QUEUE_COUNT) +#define ADDITIONAL_SURFACES (HWDEC_EXTRA_SURFACES + HWDEC_DELAY_QUEUE_COUNT) struct d3d11va_decoder { ID3D11VideoDecoder *decoder; diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c index ab91c186df..c6a34a2e70 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -32,7 +32,7 @@ #include "d3d.h" -#define ADDITIONAL_SURFACES (4 + HWDEC_DELAY_QUEUE_COUNT) +#define ADDITIONAL_SURFACES (HWDEC_EXTRA_SURFACES + HWDEC_DELAY_QUEUE_COUNT) struct priv { struct mp_log *log; diff --git a/video/decode/lavc.h b/video/decode/lavc.h index a28aa0385b..c39a06b624 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -11,6 +11,13 @@ #define HWDEC_DELAY_QUEUE_COUNT 2 +// Maximum number of surfaces the player wants to buffer. +// This number might require adjustment depending on whatever the player does; +// for example, if vo_opengl increases the number of reference surfaces for +// interpolation, this value has to be increased too. +// This value does not yet include HWDEC_DELAY_QUEUE_COUNT. +#define HWDEC_EXTRA_SURFACES 4 + typedef struct lavc_ctx { struct mp_log *log; struct MPOpts *opts; -- cgit v1.2.3