Skip to content

Commit

Permalink
MediaCapture: Fix OpenGL capture
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 12, 2024
1 parent c30c4a5 commit 422a0a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/util/media_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,12 @@ ALWAYS_INLINE_RELEASE void MediaCaptureMF::ConvertVideoFrame(u8* dst, size_t dst
// need to convert rgba -> bgra, as well as flipping vertically
const u32 vector_width = 4;
const u32 aligned_width = Common::AlignDownPow2(width, vector_width);
src += src_stride * (height - 1);

if (!g_gpu_device->UsesLowerLeftOrigin())
{
src += src_stride * (height - 1);
src_stride = static_cast<size_t>(-static_cast<std::make_signed_t<size_t>>(src_stride));
}

for (u32 remaining_rows = height;;)
{
Expand All @@ -1072,7 +1077,7 @@ ALWAYS_INLINE_RELEASE void MediaCaptureMF::ConvertVideoFrame(u8* dst, size_t dst
row_dst += sizeof(u32);
}

src -= src_stride;
src += src_stride;
dst += dst_stride;

remaining_rows--;
Expand Down

0 comments on commit 422a0a0

Please sign in to comment.