From: Steinar H. Gunderson Date: Tue, 17 Nov 2015 20:51:26 +0000 (+0100) Subject: Fix y_offset calculation if we should change the PBO size. X-Git-Tag: 1.0.0~100 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9c8a63d449829cbaa449cb177cfb01c7a1d2f358;p=nageru Fix y_offset calculation if we should change the PBO size. --- diff --git a/mixer.cpp b/mixer.cpp index 4442545..c2e5bfc 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -338,7 +338,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, size_t skipped_lines = 25; size_t cbcr_width = WIDTH / 2; size_t cbcr_offset = video_offset / 2; - size_t y_offset = cbcr_offset + cbcr_width * (HEIGHT + EXTRAHEIGHT) * sizeof(uint16_t) + video_offset / 2; + size_t y_offset = video_frame.size / 2 + video_offset / 2; glBindTexture(GL_TEXTURE_2D, userdata->tex_cbcr); check_error();