Skip to content

Commit

Permalink
Merge pull request xbmc#24704 from thexai/dxva-h264
Browse files Browse the repository at this point in the history
DXVA: Use at least 8 surfaces for H.264 decoding
  • Loading branch information
thexai authored Feb 14, 2024
2 parents 18a5d7b + ec79fcc commit 1de0486
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "utils/SystemInfo.h"
#include "utils/log.h"

#include <algorithm>
#include <mutex>

#include <Windows.h>
Expand Down Expand Up @@ -1376,7 +1377,8 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, enum AVPixel
break;
case AV_CODEC_ID_H264:
// by specification h264 decoder can hold up to 16 unique refs
m_refs += avctx->refs ? avctx->refs : 16;
// but use 8 at least to avoid potential issues in some rare streams
m_refs += std::max(8, avctx->refs ? avctx->refs : 16);
break;
case AV_CODEC_ID_VP9:
m_refs += 8;
Expand Down

0 comments on commit 1de0486

Please sign in to comment.