Skip to content

Commit

Permalink
vdisp/sdl2: fixed I420 (IYUV)
Browse files Browse the repository at this point in the history
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 107e3e3 (2024-09-02)
  • Loading branch information
MartinPulec committed Feb 3, 2025
1 parent a15c14f commit 1c56e65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video_display/sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ static bool recreate_textures(struct state_sdl2 *s, struct video_desc desc) {
(void **) &f->tiles[0].data,
&s->texture_pitch),
return false);
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);
}
Expand Down

0 comments on commit 1c56e65

Please sign in to comment.