From d20d486f745288fc1448715606e9f88dafa4342c Mon Sep 17 00:00:00 2001 From: rik Date: Thu, 14 Apr 2005 12:44:28 +0000 Subject: [PATCH] --Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>: bugfix of the "grayscale" output scheme; the height and width of the movie were written als -1 and -1 into the resulting *.bml file git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15159 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_bl.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libvo/vo_bl.c b/libvo/vo_bl.c index b6ae8bff6f..50ac0e41c0 100644 --- a/libvo/vo_bl.c +++ b/libvo/vo_bl.c @@ -68,6 +68,7 @@ static int prevpts = -1; typedef struct { char *name; /* filename */ FILE *fp; + int header_written; /* if header was written already */ } bl_file_t; typedef struct { @@ -125,18 +126,23 @@ static int bml_init(bl_file_t *f) { mp_msg(MSGT_VO, MSGL_ERR, "bl: error opening %s\n", f->name); return 1; } - fprintf(f->fp, + f->header_written = 0; + return 0; +} + +static void bml_write_frame(bl_file_t *f, unsigned char *i, int duration) { + int j, k; + if( ! f->header_written ) + { + fprintf(f->fp, "\n" "\n" "
\n" " Movie autogenerated by MPlayer\n" " http://www.mplayerhq.hu\n" "
\n", bl->width, bl->height, bl->bpc, bl->channels); - return 0; -} - -static void bml_write_frame(bl_file_t *f, unsigned char *i, int duration) { - int j, k; + f->header_written = 1; + } fprintf(f->fp, " \n", duration); for (j = 0; j < bl->height; j++) { fprintf(f->fp, " ");