summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorrik <rik@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-14 12:44:28 +0000
committerrik <rik@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-14 12:44:28 +0000
commitd20d486f745288fc1448715606e9f88dafa4342c (patch)
tree36a52031dea1ec2a4a410e8257175e6c0cbbe5ca /libvo
parent3a2bc40e8609fb3b1ed3086a77630f93c9c29653 (diff)
downloadmpv-d20d486f745288fc1448715606e9f88dafa4342c.tar.bz2
mpv-d20d486f745288fc1448715606e9f88dafa4342c.tar.xz
--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
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_bl.c18
1 files 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,
"<?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>");