[MPlayer-dev-eng] [patch] writing index in avi files > 2GB

Boris Schaefer mplayer at noid-project.de
Thu Nov 6 14:56:01 CET 2003


This patch contains a few changes (ftell -> ftello) to write the
avi-index in files > 2GB correctly.

- Boris Schaefer


diff -aur MPlayer-1.0pre2.orig/libmpdemux/muxer_avi.c
MPlayer-1.0pre2/libmpdemux/muxer_avi.c
--- MPlayer-1.0pre2.orig/libmpdemux/muxer_avi.c	2003-01-19
01:33:11.000000000 +0100
+++ MPlayer-1.0pre2/libmpdemux/muxer_avi.c	2003-11-06 14:24:53.000000000
+0100
@@ -100,7 +100,7 @@
     }
     muxer->idx[muxer->idx_pos].ckid=s->ckid;
     muxer->idx[muxer->idx_pos].dwFlags=flags; // keyframe?
-   
muxer->idx[muxer->idx_pos].dwChunkOffset=ftell(muxer->file)-(muxer->movi_start-4);
+   
muxer->idx[muxer->idx_pos].dwChunkOffset=ftello(muxer->file)-(muxer->movi_start-4);
     muxer->idx[muxer->idx_pos].dwChunkLength=len;
     ++muxer->idx_pos;
 
@@ -280,7 +280,7 @@
 }
 
 static void avifile_write_index(muxer_t *muxer){
-  muxer->movi_end=ftell(muxer->file);
+  muxer->movi_end=ftello(muxer->file);
   if(muxer->idx && muxer->idx_pos>0){
       int i;
       // fixup index entries:
@@ -291,7 +291,7 @@
       for (i=0; i<muxer->idx_pos; i++)
le2me_AVIINDEXENTRY((&muxer->idx[i]));
       muxer->avih.dwFlags|=AVIF_HASINDEX;
   }
-  muxer->file_end=ftell(muxer->file);
+  muxer->file_end=ftello(muxer->file);
 }
 
 void muxer_init_muxer_avi(muxer_t *muxer){



More information about the MPlayer-dev-eng mailing list