mirror of
https://github.com/Relintai/rpi-fbcp.git
synced 2024-11-20 06:58:53 +01:00
Fix an offset calculation error.
This commit is contained in:
parent
fb5d8fabf1
commit
bd99035701
@ -12,3 +12,8 @@ link_directories(/opt/vc/lib)
|
|||||||
add_executable(fbcp main.c)
|
add_executable(fbcp main.c)
|
||||||
|
|
||||||
target_link_libraries(fbcp bcm_host)
|
target_link_libraries(fbcp bcm_host)
|
||||||
|
|
||||||
|
|
||||||
|
set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
|
set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
6
main.c
6
main.c
@ -154,10 +154,12 @@ int process_interlaced() {
|
|||||||
uint16_t *src = &screenbuf[bufNum][firstRow * vinfo.xres + firstCol];
|
uint16_t *src = &screenbuf[bufNum][firstRow * vinfo.xres + firstCol];
|
||||||
uint16_t *dst = (uint16_t *)&fbp[(firstRow * vinfo.xres + firstCol) * 2];
|
uint16_t *dst = (uint16_t *)&fbp[(firstRow * vinfo.xres + firstCol) * 2];
|
||||||
|
|
||||||
|
uint32_t moffset = vinfo.xres * INTERLACE_NUM;
|
||||||
|
|
||||||
for(int row = firstRow; row <= lastRow; row += INTERLACE_NUM) {
|
for(int row = firstRow; row <= lastRow; row += INTERLACE_NUM) {
|
||||||
memcpy(dst, src, bytes);
|
memcpy(dst, src, bytes);
|
||||||
src += vinfo.xres;
|
src += moffset;
|
||||||
dst += vinfo.xres;
|
dst += moffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
// memcpy(fbp, screenbuf[2], vinfo.xres * vinfo.yres * 2);
|
// memcpy(fbp, screenbuf[2], vinfo.xres * vinfo.yres * 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user