Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2017-08-21 15:04:59 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-21 15:04:59 +0300
commitc8231a5013ae186c500bc73dde847f17e50106a7 (patch)
tree9cd2613b0679f9b052b7ba2b5563b3dfe1955703
parent999b2c5f328c0480de09c22ce83c3b9642ef85ef (diff)
Limit the number of buffers for VC1 DXVA/D3D11 decoding
Decoding can otherwise flicker/fail
-rw-r--r--decoder/LAVVideo/decoders/d3d11va.cpp4
-rw-r--r--decoder/LAVVideo/decoders/dxva2dec.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/d3d11va.cpp b/decoder/LAVVideo/decoders/d3d11va.cpp
index 6e524bcc..3fd51da4 100644
--- a/decoder/LAVVideo/decoders/d3d11va.cpp
+++ b/decoder/LAVVideo/decoders/d3d11va.cpp
@@ -538,6 +538,10 @@ STDMETHODIMP_(long) CDecD3D11::GetBufferCount(long *pMaxBuffers)
{
// cap at 127, because it needs to fit into the 7-bit DXVA structs
*pMaxBuffers = 127;
+
+ // VC-1 decoding has stricter requirements (decoding flickers otherwise)
+ if (m_nCodecId == AV_CODEC_ID_VC1)
+ *pMaxBuffers = 32;
}
return buffers;
diff --git a/decoder/LAVVideo/decoders/dxva2dec.cpp b/decoder/LAVVideo/decoders/dxva2dec.cpp
index dcb5ba39..a742f1cb 100644
--- a/decoder/LAVVideo/decoders/dxva2dec.cpp
+++ b/decoder/LAVVideo/decoders/dxva2dec.cpp
@@ -998,6 +998,10 @@ STDMETHODIMP_(long) CDecDXVA2::GetBufferCount(long *pMaxBuffers)
{
// cap at 127, because it needs to fit into the 7-bit DXVA structs
*pMaxBuffers = 127;
+
+ // VC-1 decoding has stricter requirements (decoding flickers otherwise)
+ if (m_nCodecId == AV_CODEC_ID_VC1)
+ *pMaxBuffers = 32;
}
return buffers;