[Mplayer-cvslog] CVS: main mplayer.c,1.104,1.105

GEREOFFY arpi_esp at users.sourceforge.net
Mon May 7 02:03:32 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv32312

Modified Files:
	mplayer.c 
Log Message:
frame dropping hack

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -r1.104 -r1.105
*** mplayer.c	2001/05/05 15:44:07	1.104
--- mplayer.c	2001/05/07 00:03:30	1.105
***************
*** 977,980 ****
--- 977,981 ----
     sh_video->our_out_buffer=NULL;
     if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){
+ //   if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){
          printf("ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll);
          printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
***************
*** 1157,1160 ****
--- 1158,1163 ----
  int osd_function=OSD_PLAY;
  int osd_last_pts=-303;
+ int drop_frame=0;
+ int drop_frame_cnt=0;
  
  #ifdef HAVE_LIRC
***************
*** 1386,1389 ****
--- 1389,1395 ----
  
      current_module="decode_video";
+     
+     if(!force_redraw && v_frame+0.1<a_frame) drop_frame=1; else drop_frame=0;
+     drop_frame_cnt+=drop_frame;
  
    //--------------------  Decode a frame: -----------------------
***************
*** 1423,1429 ****
      if(in_size>max_framesize) max_framesize=in_size;
  
!     DS_VideoDecoder_DecodeFrame(start, in_size, 0, 1);
      current_module="draw_frame";
  
        t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
        if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){
--- 1429,1436 ----
      if(in_size>max_framesize) max_framesize=in_size;
  
!     DS_VideoDecoder_DecodeFrame(start, in_size, 0, !drop_frame);
      current_module="draw_frame";
  
+     if(!drop_frame){
        t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
        if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){
***************
*** 1439,1442 ****
--- 1446,1450 ----
          video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
        t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
+     }
      break;
    }
***************
*** 1454,1463 ****
        sh_video->bih->biSizeImage = in_size;
  //      ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL), 
!       ret = ICDecompress(sh_video->hic, ICDECOMPRESS_NOTKEYFRAME, 
                           sh_video->bih,   start,
!                         &sh_video->o_bih, sh_video->our_out_buffer);
        if(ret){ printf("Error decompressing frame, err=%d\n",(int)ret);break; }
      }
      current_module="draw_frame";
        t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
  //      if(out_fmt==IMGFMT_YV12){
--- 1462,1475 ----
        sh_video->bih->biSizeImage = in_size;
  //      ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL), 
!       ret = ICDecompress(sh_video->hic, ICDECOMPRESS_NOTKEYFRAME |
!                         ( drop_frame?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , 
                           sh_video->bih,   start,
!                         &sh_video->o_bih,
!                         drop_frame ? 0 : sh_video->our_out_buffer);
! 
        if(ret){ printf("Error decompressing frame, err=%d\n",(int)ret);break; }
      }
      current_module="draw_frame";
+     if(!drop_frame){
        t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
  //      if(out_fmt==IMGFMT_YV12){
***************
*** 1474,1478 ****
          video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
        t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
! 
      break;
    }
--- 1486,1490 ----
          video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
        t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
!     }
      break;
    }
***************
*** 1552,1559 ****
      v_pts+=frame_time;
  
!     current_module="flip_page";
!     video_out->flip_page();
!     current_module=NULL;
! 
      if(eof) break;
      if(force_redraw){
--- 1564,1574 ----
      v_pts+=frame_time;
  
!     if(!drop_frame){
!         current_module="flip_page";
!         video_out->flip_page();
!         current_module=NULL;
! //        usleep(50000); // test only!
!     }
!     
      if(eof) break;
      if(force_redraw){
***************
*** 1601,1609 ****
          max_pts_correction=default_max_pts_correction;
          a_frame+=x; c_total+=x;
!         printf("  ct:%7.3f  %3d  %2d%%  %2d%%  %3.1f%% \r",c_total,
          (int)num_frames,
          (v_frame>0.5)?(int)(100.0*video_time_usage/(double)v_frame):0,
          (v_frame>0.5)?(int)(100.0*vout_time_usage/(double)v_frame):0,
          (v_frame>0.5)?(100.0*audio_time_usage/(double)v_frame):0
  //        dbg_es_sent-dbg_es_rcvd 
          );
--- 1616,1625 ----
          max_pts_correction=default_max_pts_correction;
          a_frame+=x; c_total+=x;
!         printf("  ct:%7.3f  %3d  %2d%%  %2d%%  %3.1f%% %d \r",c_total,
          (int)num_frames,
          (v_frame>0.5)?(int)(100.0*video_time_usage/(double)v_frame):0,
          (v_frame>0.5)?(int)(100.0*vout_time_usage/(double)v_frame):0,
          (v_frame>0.5)?(100.0*audio_time_usage/(double)v_frame):0
+         ,drop_frame_cnt
  //        dbg_es_sent-dbg_es_rcvd 
          );
***************
*** 1727,1730 ****
--- 1743,1750 ----
      case 'm':
        mixer_usemaster=!mixer_usemaster;
+       break;
+     case 'd':
+       drop_frame=!drop_frame;
+       printf("== drop: %d ==  \n",drop_frame);
        break;
    }


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list