[Mplayer-cvslog] CVS: main mplayer.c,1.206,1.207 dec_video.c,1.18,1.19

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 8 15:34:10 CEST 2001


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

Modified Files:
	mplayer.c dec_video.c 
Log Message:
ffmpeg12 fix - now passing sequence header

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -r1.206 -r1.207
--- mplayer.c	7 Aug 2001 16:03:30 -0000	1.206
+++ mplayer.c	8 Aug 2001 13:34:08 -0000	1.207
@@ -1252,7 +1252,7 @@
   if(file_format==DEMUXER_TYPE_MPEG_ES || file_format==DEMUXER_TYPE_MPEG_PS){
         int in_frame=0;
         float newfps;
-        videobuf_len=0;
+        //videobuf_len=0;
         while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
           int i=sync_video_packet(d_video);
 	  void* buffer=&videobuffer[videobuf_len+4];
@@ -1307,6 +1307,7 @@
     // fix mpeg2 frametime:
     frame_time=(100+picture->repeat_count)*0.01f;
     picture->repeat_count=0;
+    videobuf_len=0;
 
   } else {
       // frame-based file formats: (AVI,ASF,MOV)

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- dec_video.c	6 Aug 2001 23:58:44 -0000	1.18
+++ dec_video.c	8 Aug 2001 13:34:08 -0000	1.19
@@ -287,6 +287,7 @@
 	return 0; //exit(1);
     }
     memset(&lavc_context, 0, sizeof(lavc_context));
+//    sh_video->disp_h/=2; // !!
     lavc_context.width=sh_video->disp_w;
     lavc_context.height=sh_video->disp_h;
     printf("libavcodec.size: %d x %d\n",lavc_context.width,lavc_context.height);
@@ -406,17 +407,31 @@
 #ifdef USE_LIBAVCODEC
   case VFM_FFMPEG: {        // libavcodec
     int got_picture=0;
-    printf("Calling ffmpeg...\n");
+if(verbose) printf("Calling ffmpeg...\n");
     if(drop_frame<2 && in_size>0){
         int ret = avcodec_decode_video(&lavc_context, &lavc_picture,
 	     &got_picture, start, in_size);
-    printf("DONE -> got_picture=%d\n",got_picture);
+if(verbose){
+     unsigned char *x="???";
+     switch(lavc_context.pix_fmt){
+     case PIX_FMT_YUV420P: x="YUV420P";break;
+     case PIX_FMT_YUV422: x="YUV422";break;
+     case PIX_FMT_RGB24: x="RGB24";break;
+     case PIX_FMT_BGR24: x="BGR24";break;
+     case PIX_FMT_YUV422P: x="YUV422P";break;
+     case PIX_FMT_YUV444P: x="YUV444P";break;
+     }
+     printf("DONE -> got_picture=%d  format=0x%X (%s) \n",got_picture,
+	lavc_context.pix_fmt,x);
+}
 	if(ret<0) fprintf(stderr, "Error while decoding frame!\n");
 	if(!drop_frame && got_picture){
 //	if(!drop_frame){
 	  if(planar){
 	    planes=lavc_picture.data;
 	    stride=lavc_picture.linesize;
+	    //stride[1]=stride[2]=0;
+	    //stride[0]/=2;
             blit_frame=2;
 	  } else {
 	    int y;
@@ -579,14 +594,15 @@
 //     exit(1);
    }
    if(sync_video_packet(d_video)==0x1B5){ // next packet is seq. ext.
-    videobuf_len=0;
+//    videobuf_len=0;
+    int pos=videobuf_len;
     if(!read_video_packet(d_video)){ 
       fprintf(stderr,"FATAL: Cannot read sequence header extension!\n");
       return 0;
 //      GUI_MSG( mplMPEGErrorCannotReadSeqHeaderExt )
 //      exit(1);
     }
-    if(header_process_extension (picture, &videobuffer[4])) {
+    if(header_process_extension (picture, &videobuffer[pos+4])) {
       printf ("bad sequence header extension!\n");  
       return 0;
 //      GUI_MSG( mplMPEGErrorBadSeqHeaderExt )




More information about the MPlayer-cvslog mailing list