video: Allow pictures with half-pixels in chroma by widening the chroma buffers to the next pixel in that direction.

This commit is contained in:
David Wendt 2021-01-02 19:59:40 -05:00 committed by kmeisthax
parent 76272fd22c
commit 05692cee67
1 changed files with 2 additions and 1 deletions

View File

@ -103,8 +103,9 @@ impl VideoBackend for SoftwareVideoBackend {
.format()
.into_width_and_height()
.ok_or("H.263 decoder error!")?;
let chroma_width = picture.chroma_samples_per_row();
let (y, b, r) = picture.as_yuv();
let rgba = yuv420_to_rgba(y, b, r, width.into());
let rgba = yuv420_to_rgba(y, b, r, width.into(), chroma_width);
let handle = renderer.register_bitmap_raw(width.into(), height.into(), rgba)?;