summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-11 15:55:45 +0100
committerwm4 <wm4@nowhere>2017-01-11 16:34:18 +0100
commit5f449fc11f005b926b76106b3dd7fa6cdede232f (patch)
tree855c383c2f4921d778cb1f48da5a637169b777ee
parentfee5ceccad7d021503b278a7b5dd596efa030ba1 (diff)
downloadmpv-5f449fc11f005b926b76106b3dd7fa6cdede232f.tar.bz2
mpv-5f449fc11f005b926b76106b3dd7fa6cdede232f.tar.xz
video: share hwdec extra surface count between backends
It's a quite important and fragile magic number.
-rw-r--r--video/decode/d3d11va.c2
-rw-r--r--video/decode/dxva2.c2
-rw-r--r--video/decode/lavc.h7
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;