Bug 1210175 - Make fakeopenh264 handle odd width and height. r=webrtc-reviewers,media-playback-reviewers,bwc,aosmond

Differential Revision: https://phabricator.services.mozilla.com/D231248
This commit is contained in:
Andreas Pehrson
2025-01-29 12:16:57 +00:00
parent 8449970947
commit 385e2ae806

View File

@@ -337,7 +337,9 @@ class FakeVideoDecoder : public GMPVideoDecoder {
int width = eframe->idr_nalu.width_;
int height = eframe->idr_nalu.height_;
int ystride = eframe->idr_nalu.width_;
int uvstride = eframe->idr_nalu.width_ / 2;
// Round up so the data fits, or CreateEmptyFrame will fail on odd width and
// height.
int uvstride = (ystride + (ystride % 2)) / 2;
GMPLOG(GL_DEBUG, "Video frame ready for display "
<< width << "x" << height