]> git.sesse.net Git - nageru/blobdiff - mixer.cpp
Fix y_offset calculation if we should change the PBO size.
[nageru] / mixer.cpp
index 44425455aef52e78993aa1992acf1850be4b0f97..c2e5bfc2ec56eeb205e803c7dcbf9454c1c5b443 100644 (file)
--- 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();