Skip to content

Commit

Permalink
Cherry pick PR #787: [XB] Workaround to fix memory issue for Xbox One…
Browse files Browse the repository at this point in the history
… X (#959)

"Refer to the original PR: #787"

Co-authored-by: iuriionishchenko <[email protected]>
  • Loading branch information
1 parent 44d28a4 commit 11a0f9f
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 11a0f9f

Please sign in to comment.