summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoi Cohen <roico@roico-desktop.(none)>2007-05-28 17:49:17 +0300
committerRoi Cohen <roico@roico-desktop.(none)>2007-05-28 17:49:17 +0300
commitb2ccb31da200188bf9f820bd1ce5966aaae7625e (patch)
tree917d311f20627ccf45cf89c2df6583beaff79668
parent2920f8eb7688529b176cc595f35ffa3ae4730ee7 (diff)
downloadscreencasting-b2ccb31da200188bf9f820bd1ce5966aaae7625e.tar.gz
screencasting-b2ccb31da200188bf9f820bd1ce5966aaae7625e.tar.bz2
correctly free raw frame.
-rw-r--r--plugin/rsc2raw.c12
-rw-r--r--plugin/rsc2raw.h2
-rw-r--r--plugin/screencasting.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/plugin/rsc2raw.c b/plugin/rsc2raw.c
index bcc3502..886eb71 100644
--- a/plugin/rsc2raw.c
+++ b/plugin/rsc2raw.c
@@ -19,6 +19,18 @@ RawFrame* initRawFrame(u_int32_t width, u_int32_t height)
return frame;
}
+void freeRawFrame(RawFrame* raw_frame)
+{
+ free(raw_frame->y_raw);
+ free(raw_frame->u_raw);
+ free(raw_frame->v_raw);
+
+ free(raw_frame->u_output);
+ free(raw_frame->v_output);
+
+ free(raw_frame);
+}
+
void applyInputFrame(RawFrame* raw_frame, Frame* frame, u_int32_t width, u_int32_t height)
{
// TODO: Error-checking
diff --git a/plugin/rsc2raw.h b/plugin/rsc2raw.h
index 40636f8..718de74 100644
--- a/plugin/rsc2raw.h
+++ b/plugin/rsc2raw.h
@@ -20,6 +20,8 @@ typedef struct {
} RawFrame;
RawFrame* initRawFrame(u_int32_t width, u_int32_t height);
+void freeRawFrame(RawFrame* raw_frame);
+
void applyInputFrame(RawFrame* raw_frame, Frame* frame, u_int32_t width, u_int32_t height);
void writeOutputFrame(FILE *output, RawFrame* raw_frame, u_int32_t width, u_int32_t height);
diff --git a/plugin/screencasting.c b/plugin/screencasting.c
index 111caf9..b7d1fdb 100644
--- a/plugin/screencasting.c
+++ b/plugin/screencasting.c
@@ -187,7 +187,7 @@ secondThread(void* screen)
// Clean up.
fclose(f);
- free(raw_frame);
+ freeRawFrame(raw_frame);
freeQueue(cs->frameQueue);
cs->frameQueue = NULL;