[MPlayer-dev-eng] proposed frame stepping patch

Felix Buenemann atmosfear at users.sourceforge.net
Wed Mar 27 07:09:12 CET 2002


Hi,

attached is a patch that adds forward frame stepping using TAB key, when
mplayer is in pause mode. If frame stepping was used, mplayer will seek
one second after resuming from pause to resync audio, this will of
course only work correctly if stream is seekable.

Is it OK, to apply this to cvs?
-- 
Best Regards,
	Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.448
diff -u -r1.448 mplayer.c
--- mplayer.c	27 Mar 2002 03:45:55 -0000	1.448
+++ mplayer.c	27 Mar 2002 06:23:53 -0000
@@ -1810,6 +1810,7 @@
 #endif
 
   if(osd_function==OSD_PAUSE){
+    int flush_state = 0;
 #ifdef HAVE_NEW_INPUT    
     mp_cmd_t* cmd;
 #endif
@@ -1848,9 +1849,24 @@
 #ifdef HAVE_LIRC
              lirc_mp_getinput()<=0 &&
 #endif
-             (use_stdin || getch2(20)<=0) && mplayer_get_key()<=0){
+             (use_stdin || getch2(20)<=0) /*&& mplayer_get_key()<=0*/){
+             unsigned char* start=NULL;
+             int in_size,key;
 #endif /* HAVE_NEW_INPUT */
 	     if(sh_video && video_out) video_out->check_events();
+	     key = mplayer_get_key();
+	     if(key==9) { // TAB key does frame stepping
+		flush_state = 1;
+		current_module="decode_video";
+		video_out->control(VOCTRL_RESUME, NULL);
+		in_size=video_read_frame(sh_video,&frame_time,&start,force_fps);
+		if(in_size > 0)
+		   if(decode_video(video_out,sh_video,start,in_size,0))
+		      video_out->flip_page();
+		video_out->control(VOCTRL_PAUSE, NULL);
+		current_module=NULL;
+	     } else if(key>0)
+		break;
 #ifdef HAVE_NEW_GUI
              if(use_gui){
 		guiEventHandling();
@@ -1867,6 +1883,8 @@
       }
 #endif /* HAVE_NEW_INPUT */ 
          osd_function=OSD_PLAY;
+      // if frame stepping used, force resync audio
+      rel_seek_secs += flush_state;
       if (audio_out && sh_audio)
         audio_out->resume();	// resume audio
       if (video_out && sh_video)


More information about the MPlayer-dev-eng mailing list