summaryrefslogtreecommitdiffstats
path: root/libvo/vo_yuv4mpeg.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:10:20 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:10:20 +0000
commitca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c (patch)
treeeb22dec8700b3581b735ae10863416673aac0c70 /libvo/vo_yuv4mpeg.c
parentce701ae4386237798ffe06447021481e8e8002fc (diff)
downloadmpv-ca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c.tar.bz2
mpv-ca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c.tar.xz
New suboption type: malloc'ed, zero terminated string
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14539 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_yuv4mpeg.c')
-rw-r--r--libvo/vo_yuv4mpeg.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libvo/vo_yuv4mpeg.c b/libvo/vo_yuv4mpeg.c
index 6463657d3f..10afcd1d6d 100644
--- a/libvo/vo_yuv4mpeg.c
+++ b/libvo/vo_yuv4mpeg.c
@@ -141,12 +141,12 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
write_bytes = image_width * image_height * 3 / 2;
image = malloc(write_bytes);
- yuv_out = fopen(yuv_filename ? yuv_filename : "stream.yuv", "wb");
+ yuv_out = fopen(yuv_filename, "wb");
if (!yuv_out || image == 0)
{
mp_msg(MSGT_VO,MSGL_FATAL,
MSGTR_VO_YUV4MPEG_OutFileOpenError,
- yuv_filename ? yuv_filename : "stream.yuv");
+ yuv_filename);
return -1;
}
image_y = image;
@@ -496,17 +496,16 @@ static void check_events(void)
static uint32_t preinit(const char *arg)
{
int il, il_bf;
- strarg_t file;
opt_t subopts[] = {
{"interlaced", OPT_ARG_BOOL, &il, NULL},
{"interlaced_bf", OPT_ARG_BOOL, &il_bf, NULL},
- {"file", OPT_ARG_STR, &file, NULL},
+ {"file", OPT_ARG_MSTRZ, &yuv_filename, NULL},
{NULL}
};
il = 0;
il_bf = 0;
- file.len = 0;
+ yuv_filename = strdup("stream.yuv");
if (subopt_parse(arg, subopts) != 0) {
mp_msg(MSGT_VO, MSGL_FATAL, MSGTR_VO_YUV4MPEG_UnknownSubDev, arg);
return -1;
@@ -517,12 +516,6 @@ static uint32_t preinit(const char *arg)
config_interlace = Y4M_ILACE_TOP_FIRST;
if (il_bf)
config_interlace = Y4M_ILACE_BOTTOM_FIRST;
- yuv_filename = NULL;
- if (file.len > 0) {
- yuv_filename = malloc(file.len + 1);
- memcpy(yuv_filename, file.str, file.len);
- yuv_filename[file.len] = 0;
- }
/* Inform user which output mode is used */
switch (config_interlace)