diff options
author | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-05 16:51:15 +0000 |
---|---|---|
committer | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-05 16:51:15 +0000 |
commit | d4e83b3fdbbb30ba27b66d383ca24b58b7c63f5b (patch) | |
tree | 3b7b0d557e31c41cf444eca4731ad18daad39012 /libmpdemux/muxer_avi.c | |
parent | 79583b4ee36d12007341e4e031f0e79aad69169f (diff) | |
download | mpv-d4e83b3fdbbb30ba27b66d383ca24b58b7c63f5b.tar.bz2 mpv-d4e83b3fdbbb30ba27b66d383ca24b58b7c63f5b.tar.xz |
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13250 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/muxer_avi.c')
-rw-r--r-- | libmpdemux/muxer_avi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libmpdemux/muxer_avi.c b/libmpdemux/muxer_avi.c index a4b8f9cf91..e8faaa1223 100644 --- a/libmpdemux/muxer_avi.c +++ b/libmpdemux/muxer_avi.c @@ -195,6 +195,13 @@ static void avifile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags) 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); |