changeset 15895:7742302e793d

Do not count skipped/broken frames when using -frames
author reimar
date Sun, 03 Jul 2005 10:09:09 +0000
parents 688fa06538ef
children 404c3e1b807f
files mencoder.c mplayer.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Sat Jul 02 23:33:40 2005 +0000
+++ b/mencoder.c	Sun Jul 03 10:09:09 2005 +0000
@@ -1273,6 +1273,8 @@
     if (sh_video->vf_inited < 0) mencoder_exit(1, NULL);
     
     if(!blit_frame){
+      if (play_n_frames >= 0)
+        play_n_frames++;
       badframes++;
       if(skip_flag<=0){
 	// unwanted skipping of a frame, what to do?
--- a/mplayer.c	Sat Jul 02 23:33:40 2005 +0000
+++ b/mplayer.c	Sun Jul 03 10:09:09 2005 +0000
@@ -2240,11 +2240,6 @@
 while(!eof){
     float aq_sleep_time=0;
 
-    if(play_n_frames>=0){
-      --play_n_frames;
-      if(play_n_frames<0) eof = PT_NEXT_ENTRY;
-    }
-
 /*========================== PLAY AUDIO ============================*/
 
 while(sh_audio){
@@ -2521,6 +2516,11 @@
 		/* printf ("PANIC: too slow frame (%.3f)!\n", j); */
 
 	   if(vo_config_count) video_out->flip_page();
+	   if (play_n_frames >= 0) {
+	     --play_n_frames;
+	     if (play_n_frames < 0) eof = PT_NEXT_ENTRY;
+	   }
+
 //        usec_sleep(50000); // test only!
 	   t2=GetTimer()-t2;
 	   tt = t2*0.000001f;