# HG changeset patch # User reimar # Date 1334503423 0 # Node ID 2402be2e296f2621d5c26297a9abb81a8fa8ecf3 # Parent 37af463fd7fcdf2a7c70c489479f4caa27f8d788 Allow using -vo yuv4mpeg for files with resolution changes. Not all programs can read such files. diff -r 37af463fd7fc -r 2402be2e296f libvo/vo_yuv4mpeg.c --- a/libvo/vo_yuv4mpeg.c Sun Apr 15 15:09:34 2012 +0000 +++ b/libvo/vo_yuv4mpeg.c Sun Apr 15 15:23:43 2012 +0000 @@ -105,7 +105,6 @@ "Video formats differ (w:%i=>%i, h:%i=>%i, fps:%f=>%f), " "restarting output.\n", image_width, width, image_height, height, image_fps, vo_fps); - uninit(); } image_height = height; image_width = width; @@ -130,9 +129,11 @@ } write_bytes = image_width * image_height * 3 / 2; + free(image); image = malloc(write_bytes); - yuv_out = strcmp(yuv_filename, "-") ? fopen(yuv_filename, "wb") : stdout; + if (!yuv_out) + yuv_out = strcmp(yuv_filename, "-") ? fopen(yuv_filename, "wb") : stdout; if (!yuv_out || image == 0) { mp_msg(MSGT_VO,MSGL_FATAL,