summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_rescue.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-11 11:43:39 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-11 13:36:42 -0700
commit5b7026676952fffe82ece362f21d190f8aac66a0 (patch)
tree040cf88df64edb774b5ee8193d07293e09cf60c9 /recordmydesktop/src/rmd_rescue.c
parent94e08c4fb86eed1351faedd903e4707a490414c3 (diff)
*: no more enc_data->[xy]_offset
With no rrect alignment adjustment happening, there's no need for this fuckery anymore. The theora encoding offsets will always be left at 0, the frame_{width, height} will clip to rrect.{width,height}, and the yuv buffer dimensions are the only thing 16x16 aligned.
Diffstat (limited to 'recordmydesktop/src/rmd_rescue.c')
-rw-r--r--recordmydesktop/src/rmd_rescue.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/recordmydesktop/src/rmd_rescue.c b/recordmydesktop/src/rmd_rescue.c
index bceb257..84bcf4b 100644
--- a/recordmydesktop/src/rmd_rescue.c
+++ b/recordmydesktop/src/rmd_rescue.c
@@ -41,7 +41,6 @@
int rmdRescue(const char *path) {
- int offset_x, offset_y;
unsigned short width, height;
ProgData pdata;
EncData enc_data;
@@ -74,23 +73,17 @@ int rmdRescue(const char *path) {
width = ((pdata.brwin.rrect.width + 15) >> 4) << 4;
height = ((pdata.brwin.rrect.height + 15) >> 4) << 4;
- offset_x = ((width - pdata.brwin.rrect.width) / 2) & ~1;
- offset_y = ((height - pdata.brwin.rrect.height) / 2) & ~1;
- enc_data.yuv.y = (unsigned char *)malloc(height * width);
- enc_data.yuv.u = (unsigned char *)malloc(height * width / 4);
- enc_data.yuv.v = (unsigned char *)malloc(height * width / 4);
+ enc_data.yuv.y = malloc(height * width);
+ enc_data.yuv.u = malloc(height * width / 4);
+ enc_data.yuv.v = malloc(height * width / 4);
enc_data.yuv.y_width = width;
enc_data.yuv.y_height = height;
enc_data.yuv.y_stride = width;
- enc_data.x_offset=offset_x;
- enc_data.y_offset=offset_y;
enc_data.yuv.uv_width = width / 2;
enc_data.yuv.uv_height = height / 2;
enc_data.yuv.uv_stride = width / 2;
- enc_data.x_offset = offset_x;
- enc_data.y_offset = offset_y;
for (int i = 0; i < (enc_data.yuv.y_width * enc_data.yuv.y_height); i++)
enc_data.yuv.y[i] = 0;
© All Rights Reserved