[Mplayer-cvslog] CVS: main mencoder.c,1.15,1.16

Arpi of Ize arpi at mplayer.dev.hu
Fri Nov 2 21:05:56 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv22476

Modified Files:
	mencoder.c 
Log Message:
-srate and -pp 0 fixes

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- mencoder.c	2 Nov 2001 17:43:04 -0000	1.15
+++ mencoder.c	2 Nov 2001 20:05:36 -0000	1.16
@@ -143,7 +143,7 @@
   
   // copy Y:
   for(y=0;y<h;y++){
-      unsigned char* s=src[0]+stride[0]*(y0+y)+x0;
+      unsigned char* s=src[0]+stride[0]*y;
       unsigned char* d=vo_image+vo_w*(y0+y)+x0;
       memcpy(d,s,w);
   }
@@ -151,13 +151,13 @@
   w>>=1;h>>=1;
   // copy U:
   for(y=0;y<h;y++){
-      unsigned char* s=src[2]+stride[2]*(y0+y)+x0;
+      unsigned char* s=src[2]+stride[2]*y;
       unsigned char* d=vo_image+vo_w*vo_h+(vo_w>>1)*(y0+y)+x0;
       memcpy(d,s,w);
   }
   // copy V:
   for(y=0;y<h;y++){
-      unsigned char* s=src[1]+stride[1]*(y0+y)+x0;
+      unsigned char* s=src[1]+stride[1]*y;
       unsigned char* d=vo_image+vo_w*vo_h+vo_w*vo_h/4+(vo_w>>1)*(y0+y)+x0;
       memcpy(d,s,w);
   }
@@ -464,7 +464,7 @@
     mux_a->wf=malloc(sizeof(MPEGLAYER3WAVEFORMAT)); // should be 30
     mux_a->wf->wFormatTag=0x55; // MP3
     mux_a->wf->nChannels=sh_audio->channels;
-    mux_a->wf->nSamplesPerSec=sh_audio->samplerate;
+    mux_a->wf->nSamplesPerSec=force_srate?force_srate:sh_audio->samplerate;
     mux_a->wf->nAvgBytesPerSec=192000/8; // FIXME!
     mux_a->wf->nBlockAlign=1;
     mux_a->wf->wBitsPerSample=0; //16;
@@ -508,7 +508,7 @@
 lame_set_bWriteVbrTag(lame,0);
 lame_set_in_samplerate(lame,sh_audio->samplerate);
 lame_set_num_channels(lame,mux_a->wf->nChannels);
-lame_set_out_samplerate(lame,mux_a->h.dwRate);
+lame_set_out_samplerate(lame,mux_a->wf->nSamplesPerSec);
 if(lame_param_vbr){  // VBR:
     lame_set_VBR(lame,lame_param_vbr); // vbr mode
     lame_set_VBR_q(lame,lame_param_quality+1); // 1 = best vbr q  6=~128k
@@ -579,6 +579,7 @@
 		}
 		if(mux_a->buffer_len<4) break;
 		len=mp_decode_mp3_header(mux_a->buffer);
+		//printf("%d\n",len);
 		if(len<=0) break; // bad frame!
 		while(mux_a->buffer_len<len){
 		  unsigned char tmp[2304];
@@ -633,14 +634,14 @@
   }
 
 
-if(skip_flag<=0){ // don't have to skip frame.
 switch(mux_v->codec){
 case 0:
     mux_v->buffer=start;
-    aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
+    if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
     break;
 case VCODEC_DIVX4:
     blit_frame=decode_video(&video_out,sh_video,start,in_size,0);
+    if(skip_flag>0) break;
     if(!blit_frame){
 	// empty.
 	aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0);
@@ -676,9 +677,8 @@
 	aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0);
 	++skip_flag;
     }
-}
-
-} else {
+} else
+if(skip_flag>0){
     // skip frame
     printf("\nskip frame!!!    \n");
     --skip_flag;




More information about the MPlayer-cvslog mailing list