Mercurial > mplayer.hg
changeset 15158:d570dfbf9ef6
--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
author | rik |
---|---|
date | Thu, 14 Apr 2005 12:44:28 +0000 |
parents | c9a7876a9046 |
children | 679052437e3c |
files | libvo/vo_bl.c |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_bl.c Thu Apr 14 10:53:04 2005 +0000 +++ b/libvo/vo_bl.c Thu Apr 14 12:44:28 2005 +0000 @@ -68,6 +68,7 @@ typedef struct { char *name; /* filename */ FILE *fp; + int header_written; /* if header was written already */ } bl_file_t; typedef struct { @@ -125,18 +126,23 @@ 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, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<blm width=\"%d\" height=\"%d\" bits=\"%d\" channels=\"%d\">\n" " <header>\n" " <title>Movie autogenerated by MPlayer</title>\n" " <url>http://www.mplayerhq.hu</url>\n" " </header>\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, " <frame duration=\"%d\">\n", duration); for (j = 0; j < bl->height; j++) { fprintf(f->fp, " <row>");