wcap-decode: remove dead code

Avoids leaking memory we never use.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
dev
U. Artie Eoff 11 years ago committed by Kristian Høgsberg
parent 1db007202b
commit f05645b30e
  1. 6
      wcap/main.c

@ -214,7 +214,7 @@ int main(int argc, char *argv[])
int num = 30, denom = 1; int num = 30, denom = 1;
char filename[200]; char filename[200];
char *mode; char *mode;
uint32_t msecs, frame_time, *frame, frame_size; uint32_t msecs, frame_time;
for (i = 1, j = 1; i < argc; i++) { for (i = 1, j = 1; i < argc; i++) {
if (strcmp(argv[i], "--yuv4mpeg2-444") == 0) { if (strcmp(argv[i], "--yuv4mpeg2-444") == 0) {
@ -276,11 +276,7 @@ int main(int argc, char *argv[])
has_frame = wcap_decoder_get_frame(decoder); has_frame = wcap_decoder_get_frame(decoder);
msecs = decoder->msecs; msecs = decoder->msecs;
frame_time = 1000 * denom / num; frame_time = 1000 * denom / num;
frame_size = decoder->width * decoder->height * 4;
frame = malloc(frame_size);
while (has_frame) { while (has_frame) {
if (decoder->msecs >= msecs)
memcpy(frame, decoder->frame, frame_size);
if (all || i == output_frame) { if (all || i == output_frame) {
snprintf(filename, sizeof filename, snprintf(filename, sizeof filename,
"wcap-frame-%d.png", i); "wcap-frame-%d.png", i);

Loading…
Cancel
Save