Skip to content

Commit

Permalink
Для предпочтительного медиатипа задаем rcTarget, если оно было пустое…
Browse files Browse the repository at this point in the history
…, иначе CoreAVC Video Decoder может некорректно работать.
  • Loading branch information
v0lt committed Jan 21, 2021
1 parent 1d253e0 commit 0f89cee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/VideoRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ long CMpcVideoRenderer::CalcImageSize(CMediaType& mt, bool redefine_mt)
if (IsRectEmpty(&rcSource)) {
rcSource = { 0, 0, pBIH->biWidth, abs(pBIH->biHeight) };
}
RECT& rcTarget = ((VIDEOINFOHEADER*)mt.pbFormat)->rcTarget;
if (IsRectEmpty(&rcTarget)) {
// CoreAVC Video Decoder does not work correctly with empty rcTarget
rcTarget = rcSource;
}

DLog(L"CMpcVideoRenderer::CalcImageSize() buffer size changed from {}x{} to {}x{}", pBIH->biWidth, pBIH->biHeight, Size.cx, Size.cy);
// overwrite buffer size
Expand Down

0 comments on commit 0f89cee

Please sign in to comment.