[Mplayer-cvslog] CVS: main/libmpdemux muxer_avi.c,1.27,1.28

Richard Felker CVS syncmail at mplayerhq.hu
Sun Sep 5 18:51:18 CEST 2004


CVS change done by Richard Felker CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv28325/libmpdemux

Modified Files:
	muxer_avi.c 
Log Message:
ensure that avi files have a valid header as soon as possible.
without this, the header says 0x0 video size, which works with mplayer
when the video size is stored in the codec data, but it does NOT work
with other players or with codecs that don't store size (e.g. snow).

actually i don't like having seeks in the muxer module, but i don't
know any other way to implement this fix without major changes to
mencoder. if you have a better fix, please reverse this and commit
yours.


Index: muxer_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_avi.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- muxer_avi.c	23 May 2004 07:34:32 -0000	1.27
+++ muxer_avi.c	5 Sep 2004 16:51:15 -0000	1.28
@@ -195,6 +195,13 @@
     struct avi_stream_info *vsi = muxer->def_v->priv;
     int paddedlen = len + (len&1);
 
+    if (s->type == MUXER_TYPE_VIDEO && !s->h.dwSuggestedBufferSize) {
+	off_t pos=ftell(muxer->file);
+	fseek(muxer->file, 0, SEEK_SET);
+	avifile_write_header(muxer);
+	fseek(muxer->file, pos, SEEK_SET);
+    }
+
     rifflen = muxer->file_end - vsi->riffofs[vsi->riffofspos] - 8;
     if (vsi->riffofspos == 0) {
 	rifflen += 8+muxer->idx_pos*sizeof(AVIINDEXENTRY);




More information about the MPlayer-cvslog mailing list