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-11 01:05:12 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-11 17:22:40 +0300
commite7b57278884facb189f44830215c8019ad753fe2 (patch)
tree19e58c8414dc275884ed85edc9faa4db42d426a0 /decoder
parent465f06e157379521bcda5a8220e658d9a5a41f14 (diff)
Cap the number of samples to 127 in the allocator.
DXVA data structures require to store the surface index in 7-bit.
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVVideo/LAVVideo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp
index 97ccee30..936471a0 100644
--- a/decoder/LAVVideo/LAVVideo.cpp
+++ b/decoder/LAVVideo/LAVVideo.cpp
@@ -514,8 +514,9 @@ HRESULT CLAVVideo::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERT
CMediaType &mtOut = m_pOutput->CurrentMediaType();
videoFormatTypeHandler(mtOut, &pBIH);
+ // try to honor the requested number of downstream buffers, but cap at 127, because the amount needs to fit into 7-bit for DXVA decoding
long downstreamBuffers = pProperties->cBuffers;
- pProperties->cBuffers = max(pProperties->cBuffers, 2) + m_Decoder.GetBufferCount();
+ pProperties->cBuffers = min(max(pProperties->cBuffers, 2) + m_Decoder.GetBufferCount(), 127);
pProperties->cbBuffer = pBIH ? pBIH->biSizeImage : 3110400;
pProperties->cbAlign = 1;
pProperties->cbPrefix = 0;