Fix black-screen video on unaligned widths (swscale row padding)
Some checks failed
build / build (push) Failing after 1m41s

swscale aligns the RGBA linesize to a SIMD boundary, so any video whose
width*4 isn't a multiple of the alignment (e.g. 1674-wide → 6720 B/row vs
6696) yields a padded plane larger than width*height*4. The old copy path
tripped a `need > expected → skip` guard and dropped every video frame,
leaving a black screen while audio (independent path) still played.

Read Frame.imageStride and strip the row padding with a row-by-row memCopy
into a tightly-packed slot (width*height*4), matching the texture's expected
size. Falls back to deriving the stride from buffer size when the field is
absent. Single-shot memCopy retained when stride == rowBytes (aligned widths).

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
tkrmagid
2026-06-02 00:59:44 +09:00
parent 7364e010ac
commit e31635ef24
2 changed files with 55 additions and 24 deletions

View File

@@ -5,7 +5,7 @@ org.gradle.configuration-cache=false
# Mod
mod_id=video_player
mod_version=0.4.32
mod_version=0.4.33
maven_group=com.ejclaw.videoplayer
archives_base_name=video_player