mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 09:40:30 +00:00
vdisp/sdl2: fixed I420 (IYUV)
The pitch for planar pixel formats is the pitch of the first plane,
most likely =width. This yield wrong data_len for I420 if just multiplied
by the height.
this fixes the change made by 107e3e30 (2024-09-02)
This commit is contained in:
@@ -468,7 +468,9 @@ static bool recreate_textures(struct state_sdl2 *s, struct video_desc desc) {
|
||||
struct video_frame *f = vf_alloc_desc(desc);
|
||||
f->callbacks.dispose_udata = (void *) texture;
|
||||
SDL_CHECK(SDL_LockTexture(texture, NULL, (void **) &f->tiles[0].data, &s->texture_pitch));
|
||||
f->tiles[0].data_len = desc.height * s->texture_pitch;
|
||||
if (!codec_is_planar(desc.color_spec)) {
|
||||
f->tiles[0].data_len = desc.height * s->texture_pitch;
|
||||
}
|
||||
f->callbacks.data_deleter = vf_sdl_texture_data_deleter;
|
||||
simple_linked_list_append(s->free_frame_queue, f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user