Skip to content

Commit

Permalink
[XB] Workaround to fix memory issue for Xbox One X (#787)
Browse files Browse the repository at this point in the history
Number of the video decoder output buffers was decreased from 10 to 5

b/268591344

Change-Id: Icbbdab428196c119e606ef7653b3b17a8e9ec846
(cherry picked from commit 0a69bb9)
  • Loading branch information
iuriionishchenko authored and TyHolc committed Jul 31, 2023
1 parent 44d28a4 commit cd93aa7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions starboard/shared/win32/video_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ void VideoDecoder::InitializeCodec() {

ComPtr<IMFAttributes> attributes = transform->GetAttributes();
SB_DCHECK(attributes);
CheckResult(attributes->SetUINT32(MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNT,
kMaxOutputSamples));
CheckResult(
attributes->SetUINT32(MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNT,
static_cast<UINT32>(GetMaxNumberOfCachedFrames())));

UpdateVideoArea(transform->GetCurrentOutputType());

Expand Down Expand Up @@ -704,7 +705,7 @@ void VideoDecoder::DecoderThreadRun() {
// MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNT.
thread_lock_.Acquire();
bool input_full = thread_events_.size() >= kMaxInputSamples;
bool output_full = thread_outputs_.size() >= kMaxOutputSamples;
bool output_full = thread_outputs_.size() >= GetMaxNumberOfCachedFrames();
thread_lock_.Release();

Status status = input_full ? kBufferFull : kNeedMoreInput;
Expand Down

0 comments on commit cd93aa7

Please sign in to comment.