[MPlayer-dev-eng] Re: Some cleanup about mencoder.

Andriy N. Gritsenko andrej at lucky.net
Sat Jan 18 19:49:13 CET 2003


    Hi, Arpi!

Sometime (on Saturday, January 18 at 19:56) I've received something...
>so it's enough to pass muxer_stream to the encoders (and so muxer_write_chunk)
>(as done already) and no need for mencoder_write_chunk() callback.

>so make a patch for it or shut down this topic.

I did it (attached) so, please, commit. :)

    Be happy!
    Andriy.
-------------- next part --------------
diff -udpr MPlayer-20030118.orig/TOOLS/vivodump.c MPlayer-20030118/TOOLS/vivodump.c
--- MPlayer-20030118.orig/TOOLS/vivodump.c	Sat Dec 28 00:43:17 2002
+++ MPlayer-20030118/TOOLS/vivodump.c	Sat Jan 18 20:36:58 2003
@@ -149,7 +149,7 @@ int pos=0;
 int frames=0;
 FILE *f=fopen("paulvandykforanangel.viv","rb");
 FILE *f2=fopen("GB1.avi","wb");
-muxer_t* avi=muxer_new_muxer(MUXER_TYPE_AVI);
+muxer_t* avi=muxer_new_muxer(MUXER_TYPE_AVI,f2);
 muxer_stream_t* mux=muxer_new_stream(avi,MUXER_TYPE_VIDEO);
 //unsigned char* buffer=malloc(0x200000);
 int i,len;
@@ -169,7 +169,7 @@ mux->bih->biSize=sizeof(BITMAPINFOHEADER
 mux->bih->biPlanes=1;
 mux->bih->biBitCount=24;
 mux->bih->biCompression=0x6f766976;//      7669766f;
-muxer_write_header(avi,f2);
+muxer_write_header(avi);
 
 /*
 c=fgetc(f); if(c) printf("error! not vivo file?\n");
@@ -222,7 +222,7 @@ while((c=fgetc(f))>=0){
 	// end of frame:
 	printf("Frame size: %d\n",mux->buffer_len);
 	h263_decode_picture_header(mux->buffer);
-	muxer_write_chunk(avi,mux,f2,mux->buffer_len,0x10);
+	muxer_write_chunk(mux,mux->buffer_len,0x10);
 	mux->buffer_len=0;
 	
 	if((v_id&0xF0)==0x10) fprintf(stderr,"hmm. last video packet %02X\n",v_id);
@@ -258,8 +258,8 @@ mux->bih->biWidth=width;
 mux->bih->biHeight=height;
 mux->bih->biSizeImage=3*width*height;
 
-muxer_write_index(avi,f2);
+muxer_write_index(avi);
 fseek(f2,0,SEEK_SET);
-muxer_write_header(avi,f2);
+muxer_write_header(avi);
 
 }
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_divx4.c MPlayer-20030118/libmpcodecs/ve_divx4.c
--- MPlayer-20030118.orig/libmpcodecs/ve_divx4.c	Sat Dec 28 00:43:19 2002
+++ MPlayer-20030118/libmpcodecs/ve_divx4.c	Sat Jan 18 20:36:58 2003
@@ -44,7 +44,6 @@
 
 static int pass;
 extern char* passtmpfile;
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
 
 #include <encore2.h>
 
@@ -273,7 +272,7 @@ static int put_image(struct vf_instance_
 					       enc_result.quantizer);
 	}
     }
-    mencoder_write_chunk(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
+    muxer_write_chunk(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
     return 1;
 }
 
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_lavc.c MPlayer-20030118/libmpcodecs/ve_lavc.c
--- MPlayer-20030118.orig/libmpcodecs/ve_lavc.c	Sun Jan  5 18:06:17 2003
+++ MPlayer-20030118/libmpcodecs/ve_lavc.c	Sat Jan 18 20:36:58 2003
@@ -27,7 +27,6 @@
 #include "vf.h"
 
 extern char* passtmpfile;
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
 
 //===========================================================================//
 
@@ -486,7 +485,7 @@ static int put_image(struct vf_instance_
 	out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,
 	    pic);
 
-    mencoder_write_chunk(mux_v,out_size,lavc_venc_context->coded_frame->key_frame?0x10:0);
+    muxer_write_chunk(mux_v,out_size,lavc_venc_context->coded_frame->key_frame?0x10:0);
         
 #if LIBAVCODEC_BUILD >= 4643
     /* store psnr / pict size / type / qscale */
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_libdv.c MPlayer-20030118/libmpcodecs/ve_libdv.c
--- MPlayer-20030118.orig/libmpcodecs/ve_libdv.c	Sat Dec 28 00:43:19 2002
+++ MPlayer-20030118/libmpcodecs/ve_libdv.c	Sat Jan 18 20:36:58 2003
@@ -23,8 +23,6 @@
 
 #include <libdv/dv.h>
 
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
-
 #ifndef DV_WIDTH
 #define DV_WIDTH       720
 #define DV_PAL_HEIGHT  576
@@ -78,7 +76,7 @@ static int put_image(struct vf_instance_
 	(mpi->flags&MP_IMGFLAG_YUV) ? e_dv_color_yuv : e_dv_color_rgb,
 	mux_v->buffer);
 
-    mencoder_write_chunk(mux_v, 480 * (vf->priv->enc->isPAL ? 300 : 250) , 0x10);
+    muxer_write_chunk(mux_v, 480 * (vf->priv->enc->isPAL ? 300 : 250) , 0x10);
     return 1;
 }
 
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_qtvideo.c MPlayer-20030118/libmpcodecs/ve_qtvideo.c
--- MPlayer-20030118.orig/libmpcodecs/ve_qtvideo.c	Fri Jan  3 14:26:16 2003
+++ MPlayer-20030118/libmpcodecs/ve_qtvideo.c	Sat Jan 18 20:36:58 2003
@@ -90,8 +90,6 @@ static    long (*CountComponents)(Compon
 static    OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3);
 
 
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
-
 
 //static int format=mmioFOURCC('S','V','Q','1');
 static int format=mmioFOURCC('S','V','Q','3');
@@ -260,7 +258,7 @@ if(!codec_inited){
     printf("Size %i->%i   \n",stride*height,compressedsize);
     printf("Ratio: %i:1\n",(stride*height)/compressedsize);
 #endif
-    mencoder_write_chunk(mux_v, compressedsize , similarity?0:0x10);
+    muxer_write_chunk(mux_v, compressedsize , similarity?0:0x10);
 
     if(((*desc)->idSize)>MAX_IDSIZE){
 	printf("FATAL! idSize=%d too big, increase MAX_IDSIZE in ve_qtvideo.c!\n",((*desc)->idSize));
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_rawrgb.c MPlayer-20030118/libmpcodecs/ve_rawrgb.c
--- MPlayer-20030118.orig/libmpcodecs/ve_rawrgb.c	Sat Dec 28 00:43:19 2002
+++ MPlayer-20030118/libmpcodecs/ve_rawrgb.c	Sat Jan 18 20:36:58 2003
@@ -16,8 +16,6 @@
 #include "mp_image.h"
 #include "vf.h"
 
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
-
 //===========================================================================//
 
 struct vf_priv_s {
@@ -48,7 +46,7 @@ static int query_format(struct vf_instan
 
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
     mux_v->buffer=mpi->planes[0];
-    mencoder_write_chunk(mux_v, mpi->width*mpi->height*3, 0x10);
+    muxer_write_chunk(mux_v, mpi->width*mpi->height*3, 0x10);
     return 1;
 }
 
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_vfw.c MPlayer-20030118/libmpcodecs/ve_vfw.c
--- MPlayer-20030118.orig/libmpcodecs/ve_vfw.c	Sat Dec 28 00:43:19 2002
+++ MPlayer-20030118/libmpcodecs/ve_vfw.c	Sat Jan 18 20:36:58 2003
@@ -25,8 +25,6 @@
 
 #include "muxer.h"
 
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
-
 //===========================================================================//
 
 static char *vfw_param_codec = NULL;
@@ -244,7 +242,7 @@ static int put_image(struct vf_instance_
     int ret;
 //    flip_upside_down(vo_image_ptr,vo_image_ptr,3*vo_w,vo_h); // dirty hack
     ret=vfw_encode_frame(mux_v->bih, mux_v->buffer, vfw_bih, mpi->planes[0], &flags, 10000);
-    mencoder_write_chunk(mux_v,mux_v->bih->biSizeImage,flags);
+    muxer_write_chunk(mux_v,mux_v->bih->biSizeImage,flags);
     return 1;
 }
 
diff -udpr MPlayer-20030118.orig/libmpcodecs/ve_xvid.c MPlayer-20030118/libmpcodecs/ve_xvid.c
--- MPlayer-20030118.orig/libmpcodecs/ve_xvid.c	Sat Dec 28 00:43:19 2002
+++ MPlayer-20030118/libmpcodecs/ve_xvid.c	Sat Jan 18 20:36:58 2003
@@ -65,7 +65,6 @@ static int const motion_presets[7] = {
 };
 
 extern char* passtmpfile;
-extern void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags);
 
 static int xvidenc_pass = 0;
 static int xvidenc_quality = 4;
@@ -454,7 +453,7 @@ put_image(struct vf_instance_s* vf, mp_i
     }
     
     // write output
-    mencoder_write_chunk(fp->mux, fp->enc_frame.length, fp->enc_frame.intra==1 ? 0x10 : 0);
+    muxer_write_chunk(fp->mux, fp->enc_frame.length, fp->enc_frame.intra==1 ? 0x10 : 0);
 
     // update the VBR engine
     vbrUpdate(&fp->vbr_state, enc_stats.quant, fp->enc_frame.intra,
diff -udpr MPlayer-20030118.orig/libmpdemux/muxer.c MPlayer-20030118/libmpdemux/muxer.c
--- MPlayer-20030118.orig/libmpdemux/muxer.c	Sat Dec 28 02:48:07 2002
+++ MPlayer-20030118/libmpdemux/muxer.c	Sat Jan 18 20:36:58 2003
@@ -12,11 +12,12 @@
 #include "wine/avifmt.h"
 #include "wine/vfw.h"
 
 #include "muxer.h"
 
-muxer_t* muxer_new_muxer(int type){
+muxer_t *muxer_new_muxer(int type,FILE *f){
     muxer_t* muxer=malloc(sizeof(muxer_t));
     memset(muxer,0,sizeof(muxer_t));
+    muxer->file = f;
     switch (type) {
       case MUXER_TYPE_MPEG:
 	muxer_init_muxer_mpeg(muxer);
diff -udpr MPlayer-20030118.orig/libmpdemux/muxer.h MPlayer-20030118/libmpdemux/muxer.h
--- MPlayer-20030118.orig/libmpdemux/muxer.h	Sat Dec 28 00:43:20 2002
+++ MPlayer-20030118/libmpdemux/muxer.h	Sat Jan 18 20:36:58 2003
@@ -34,6 +34,8 @@ typedef struct {
   // mpeg specific:
   unsigned int gop_start; // frame number of this GOP start
   size_t ipb[3]; // sizes of I/P/B frames
+  // muxer of that stream
+  struct muxer_t *muxer;
 } muxer_stream_t;
 
 typedef struct {
@@ -57,17 +59,18 @@ typedef struct muxer_t{
   //int num_streams;
   muxer_stream_t* def_v;  // default video stream (for general headers)
   muxer_stream_t* streams[MUXER_MAX_STREAMS];
-  void (*cont_write_chunk)(struct muxer_t *,muxer_stream_t *,FILE *,size_t,unsigned int);
-  void (*cont_write_header)(struct muxer_t *,FILE *);
-  void (*cont_write_index)(struct muxer_t *,FILE *);
+  void (*cont_write_chunk)(muxer_stream_t *,size_t,unsigned int);
+  void (*cont_write_header)(struct muxer_t *);
+  void (*cont_write_index)(struct muxer_t *);
   muxer_stream_t* (*cont_new_stream)(struct muxer_t *,int);
+  FILE* file;
 } muxer_t;
 
-muxer_t* muxer_new_muxer(int type);
+muxer_t *muxer_new_muxer(int type,FILE *);
 #define muxer_new_stream(muxer,a) muxer->cont_new_stream(muxer,a)
-#define muxer_write_chunk(muxer,a,b,c,d) muxer->cont_write_chunk(muxer,a,b,c,d)
-#define muxer_write_header(muxer,f) muxer->cont_write_header(muxer,f)
-#define muxer_write_index(muxer,f) muxer->cont_write_index(muxer,f)
+#define muxer_write_chunk(a,b,c) a->muxer->cont_write_chunk(a,b,c)
+#define muxer_write_header(muxer) muxer->cont_write_header(muxer)
+#define muxer_write_index(muxer) muxer->cont_write_index(muxer)
 
 void muxer_init_muxer_avi(muxer_t *);
 void muxer_init_muxer_mpeg(muxer_t *);
diff -udpr MPlayer-20030118.orig/libmpdemux/muxer_avi.c MPlayer-20030118/libmpdemux/muxer_avi.c
--- MPlayer-20030118.orig/libmpdemux/muxer_avi.c	Sat Dec 28 02:48:07 2002
+++ MPlayer-20030118/libmpdemux/muxer_avi.c	Sat Jan 18 20:38:51 2003
@@ -30,6 +30,7 @@ extern char *info_comment;
 
 static muxer_stream_t* avifile_new_stream(muxer_t *muxer,int type){
     muxer_stream_t* s;
+    if (!muxer) return NULL;
     if(muxer->avih.dwStreams>=MUXER_MAX_STREAMS){
 	printf("Too many streams! increase MUXER_MAX_STREAMS !\n");
 	return NULL;
@@ -42,6 +43,7 @@ static muxer_stream_t* avifile_new_strea
     s->id=muxer->avih.dwStreams;
     s->timer=0.0;
     s->size=0;
+    s->muxer=muxer;
     switch(type){
     case MUXER_TYPE_VIDEO:
       s->ckid=mmioFOURCC(('0'+s->id/10),('0'+(s->id%10)),'d','c');
@@ -88,7 +90,8 @@ if(len>0){
 }
 }
 
-static void avifile_write_chunk(muxer_t *muxer,muxer_stream_t *s, FILE *f,size_t len,unsigned int flags){
+static void avifile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags){
+    muxer_t *muxer=s->muxer;
 
     // add to the index:
     if(muxer->idx_pos>=muxer->idx_size){
@@ -97,12 +100,12 @@ static void avifile_write_chunk(muxer_t 
     }
     muxer->idx[muxer->idx_pos].ckid=s->ckid;
     muxer->idx[muxer->idx_pos].dwFlags=flags; // keyframe?
-    muxer->idx[muxer->idx_pos].dwChunkOffset=ftell(f)-(muxer->movi_start-4);
+    muxer->idx[muxer->idx_pos].dwChunkOffset=ftell(muxer->file)-(muxer->movi_start-4);
     muxer->idx[muxer->idx_pos].dwChunkLength=len;
     ++muxer->idx_pos;
 
     // write out the chunk:
-    write_avi_chunk(f,s->ckid,len,s->buffer); /* unsigned char */
+    write_avi_chunk(muxer->file,s->ckid,len,s->buffer); /* unsigned char */
 
     // alter counters:
     if(s->h.dwSampleSize){
@@ -135,11 +138,12 @@ static void write_avi_list(FILE *f,unsig
 // muxer->streams[i]->wf->cbSize
 #define WFSIZE(wf) (sizeof(WAVEFORMATEX)+(((wf)->cbSize)?((wf)->cbSize-2):0))
 
-static void avifile_write_header(muxer_t *muxer,FILE *f){
+static void avifile_write_header(muxer_t *muxer){
   uint32_t riff[3];
   unsigned int i;
   unsigned int hdrsize;
   muxer_info_t info[16];
+  FILE *f=muxer->file;
 
   // RIFF header:
   riff[0]=mmioFOURCC('R','I','F','F');
@@ -275,19 +279,19 @@ info[i].id=0;
   muxer->movi_start=ftell(f);
 }
 
-static void avifile_write_index(muxer_t *muxer,FILE *f){
-  muxer->movi_end=ftell(f);
+static void avifile_write_index(muxer_t *muxer){
+  muxer->movi_end=ftell(muxer->file);
   if(muxer->idx && muxer->idx_pos>0){
       int i;
       // fixup index entries:
 //      for(i=0;i<muxer->idx_pos;i++) muxer->idx[i].dwChunkOffset-=muxer->movi_start-4;
       // write index chunk:
       for (i=0; i<muxer->idx_pos; i++) le2me_AVIINDEXENTRY((&muxer->idx[i]));
-      write_avi_chunk(f,ckidAVINEWINDEX,16*muxer->idx_pos,muxer->idx); /* AVIINDEXENTRY */
+      write_avi_chunk(muxer->file,ckidAVINEWINDEX,16*muxer->idx_pos,muxer->idx); /* AVIINDEXENTRY */
       for (i=0; i<muxer->idx_pos; i++) le2me_AVIINDEXENTRY((&muxer->idx[i]));
       muxer->avih.dwFlags|=AVIF_HASINDEX;
   }
-  muxer->file_end=ftell(f);
+  muxer->file_end=ftell(muxer->file);
 }
 
 void muxer_init_muxer_avi(muxer_t *muxer){
diff -udpr MPlayer-20030118.orig/libmpdemux/muxer_mpeg.c MPlayer-20030118/libmpdemux/muxer_mpeg.c
--- MPlayer-20030118.orig/libmpdemux/muxer_mpeg.c	Sat Dec 28 00:43:20 2002
+++ MPlayer-20030118/libmpdemux/muxer_mpeg.c	Sat Jan 18 20:40:35 2003
@@ -32,6 +32,7 @@
 static muxer_stream_t* mpegfile_new_stream(muxer_t *muxer,int type){
   muxer_stream_t *s;
 
+  if (!muxer) return NULL;
   if(muxer->avih.dwStreams>=MUXER_MAX_STREAMS){
     printf("Too many streams! increase MUXER_MAX_STREAMS !\n");
     return NULL;
@@ -75,6 +76,7 @@ static muxer_stream_t* mpegfile_new_stre
   s->id=muxer->avih.dwStreams;
   s->timer=0.0;
   s->size=0;
+  s->muxer=muxer;
   muxer->avih.dwStreams++;
   return s;
 }
@@ -239,10 +241,13 @@ static void set_mpeg_pts(muxer_t *muxer,
   write_mpeg_ts (s->b_buffer+7, dts, 0x10);
 }
 
-static void mpegfile_write_chunk(muxer_t *muxer,muxer_stream_t *s,FILE *f,size_t len,unsigned int flags){
+static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags){
   size_t ptr=0, sz;
   unsigned int pts=0;
+  muxer_t *muxer = s->muxer;
+  FILE *f;
 
+  f = muxer->file;
   if (s->type == MUXER_TYPE_VIDEO) { // try to recognize frame type...
     if (s->buffer[0] != 0 || s->buffer[1] != 0 || s->buffer[2] != 1 || len<6) {
       printf ("Unknown block type, possibly non-MPEG stream!\n");
@@ -358,13 +363,14 @@ static void mpegfile_write_chunk(muxer_t
   }
 }
 
-static void mpegfile_write_header(muxer_t *muxer,FILE *f){
+static void mpegfile_write_header(muxer_t *muxer){
   unsigned int i;
   size_t sz = MUXER_MPEG_BLOCKSIZE-24;
   unsigned char buff[12];
   muxer_stream_t *s = muxer->streams[0];
   uint32_t l1;
   uint16_t l2;
+  FILE *f = muxer->file;
 
   if (s == NULL)
     return; // no streams!?
@@ -407,7 +413,7 @@ static void mpegfile_write_header(muxer_
   muxer->movi_end = MUXER_MPEG_BLOCKSIZE;
 }
 
-static void mpegfile_write_index(muxer_t *muxer,FILE *f){
+static void mpegfile_write_index(muxer_t *muxer){
   unsigned int i;
   unsigned int rsr;
 
@@ -415,9 +421,9 @@ static void mpegfile_write_index(muxer_t
   // finish all but one video and audio streams
   rsr = muxer->sysrate; // reserve it since it's silly change it at that point
   for (i = 0; i < muxer->avih.dwStreams-1; i++)
-    write_mpeg_block (muxer, muxer->streams[i], f, NULL, 0, 0);
+    write_mpeg_block (muxer, muxer->streams[i], muxer->file, NULL, 0, 0);
   // end sequence: ISO-11172-End (0x1b9) and finish very last block
-  write_mpeg_block (muxer, muxer->streams[i], f, NULL, 0, 1);
+  write_mpeg_block (muxer, muxer->streams[i], muxer->file, NULL, 0, 1);
 //fprintf (stderr, "PTS to SCR delay: min %u.%03u, max %u.%03u\n",
 //	mpeg_min_delay/90000, (mpeg_min_delay/90)%1000,
 //	mpeg_max_delay/90000, (mpeg_max_delay/90)%1000);
diff -udpr MPlayer-20030118.orig/mencoder.c MPlayer-20030118/mencoder.c
--- MPlayer-20030118.orig/mencoder.c	Fri Jan 17 01:03:06 2003
+++ MPlayer-20030118/mencoder.c	Sat Jan 18 20:36:58 2003
@@ -306,11 +306,6 @@ static void exit_sighandler(int x){
 static muxer_t* muxer=NULL;
 static FILE* muxer_f=NULL;
 
-// callback for ve_*.c:
-void mencoder_write_chunk(muxer_stream_t *s,int len,unsigned int flags){
-    muxer_write_chunk(muxer,s,muxer_f,len,flags);
-}
-
 extern void print_wave_header(WAVEFORMATEX *h);
 
 int main(int argc,char* argv[]){
@@ -606,7 +601,7 @@ if(!muxer_f) {
   mencoder_exit(1,NULL);
 }
 
-muxer=muxer_new_muxer(out_file_format);
+muxer=muxer_new_muxer(out_file_format,muxer_f);
 
 // ============= VIDEO ===============
 
@@ -815,7 +810,7 @@ if(audio_delay!=0.0){
 } // if(sh_audio)
 
 printf(MSGTR_WritingAVIHeader);
-muxer_write_header(muxer,muxer_f);
+muxer_write_header(muxer);
 
 decoded_frameno=0;
 
@@ -1001,7 +996,7 @@ if(sh_audio){
 	    }
 	}
 	if(len<=0) break; // EOF?
-	muxer_write_chunk(muxer,mux_a,muxer_f,len,0x10);
+	muxer_write_chunk(mux_a,len,0x10);
 	if(!mux_a->h.dwSampleSize && mux_a->timer>0)
 	    mux_a->wf->nAvgBytesPerSec=0.5f+(double)mux_a->size/mux_a->timer; // avg bps (VBR)
 	if(mux_a->buffer_len>=len){
@@ -1081,11 +1076,11 @@ ptimer_start = GetTimerMS();
 switch(mux_v->codec){
 case VCODEC_COPY:
     mux_v->buffer=start;
-    if(skip_flag<=0) muxer_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
+    if(skip_flag<=0) muxer_write_chunk(mux_v,in_size,(sh_video->ds->flags&1)?0x10:0);
     break;
 case VCODEC_FRAMENO:
     mux_v->buffer=(unsigned char *)&decoded_frameno; // tricky
-    if(skip_flag<=0) muxer_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10);
+    if(skip_flag<=0) muxer_write_chunk(mux_v,sizeof(int),0x10);
     break;
 default:
     // decode_video will callback down to ve_*.c encoders, through the video filters
@@ -1096,7 +1091,7 @@ default:
 	// unwanted skipping of a frame, what to do?
 	if(skip_limit==0){
 	    // skipping not allowed -> write empty frame:
-	    muxer_write_chunk(muxer,mux_v,muxer_f,0,0);
+	    muxer_write_chunk(mux_v,0,0);
 	} else {
 	    // skipping allowed -> skip it and distriubute timer error:
 	    v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate;
@@ -1113,7 +1108,7 @@ if(skip_flag<0){
 	if(!tv_param_on && !verbose) printf(MSGTR_DuplicateFrames,-skip_flag);
     while(skip_flag<0){
 	duplicatedframes++;
-	muxer_write_chunk(muxer,mux_v,muxer_f,0,0);
+	muxer_write_chunk(mux_v,0,0);
 	++skip_flag;
     }
 } else
@@ -1272,11 +1267,11 @@ if(sh_audio && mux_a->codec==ACODEC_VBRM
 #endif
 
 printf(MSGTR_WritingAVIIndex);
-muxer_write_index(muxer,muxer_f);
+muxer_write_index(muxer);
 muxer_f_size=ftello(muxer_f);
 printf(MSGTR_FixupAVIHeader);
 fseek(muxer_f,0,SEEK_SET);
-muxer_write_header(muxer,muxer_f); // update header
+muxer_write_header(muxer); // update header
 if(ferror(muxer_f) || fclose(muxer_f) != 0) {
     mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile, out_filename);
     mencoder_exit(1, NULL);


More information about the MPlayer-dev-eng mailing list