changeset 6590:bfc209bb3f48

-frames 0 fix, multifile frames support by tibcu
author alex
date Fri, 28 Jun 2002 17:13:18 +0000
parents 1595ca898d3b
children b408ba1e7402
files cfg-common.h mencoder.c mplayer.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-common.h	Fri Jun 28 16:48:10 2002 +0000
+++ b/cfg-common.h	Fri Jun 28 17:13:18 2002 +0000
@@ -49,7 +49,7 @@
 // ------------------------- demuxer options --------------------
 
 	// number of frames to play/convert
-	{"frames", &play_n_frames, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},
+	{"frames", &play_n_frames_mf, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},
 
 	// seek to byte/seconds position
 	{"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},
--- a/mencoder.c	Fri Jun 28 16:48:10 2002 +0000
+++ b/mencoder.c	Fri Jun 28 17:13:18 2002 +0000
@@ -153,6 +153,7 @@
 int pass_working=0;
 
 static int play_n_frames=-1;
+static int play_n_frames_mf=-1;
 
 #include "libvo/font_load.h"
 #include "libvo/sub.h"
@@ -800,6 +801,8 @@
 	default_max_pts_correction = 0;
 	}
 
+play_n_frames=play_n_frames_mf;
+
 while(!at_eof){
 
     float frame_time=0;
--- a/mplayer.c	Fri Jun 28 16:48:10 2002 +0000
+++ b/mplayer.c	Fri Jun 28 17:13:18 2002 +0000
@@ -233,6 +233,7 @@
 static int force_srate=0;
 static int frame_dropping=0; // option  0=no drop  1= drop vo  2= drop decode
 static int play_n_frames=-1;
+static int play_n_frames_mf=-1;
 
 // screen info:
 char* video_driver=NULL; //"mga"; // default
@@ -1489,12 +1490,18 @@
 total_time_usage_start=GetTimer();
 audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
 total_frame_cnt=0; drop_frame_cnt=0; // fix for multifile fps benchmark
+play_n_frames=play_n_frames_mf;
+
+if(play_n_frames==0){
+  eof=PT_NEXT_ENTRY; goto goto_next_file;
+}
+
 while(!eof){
     float aq_sleep_time=0;
 
     if(play_n_frames>=0){
       --play_n_frames;
-      if(play_n_frames<0) eof = PT_NEXT_ENTRY;
+      if(play_n_frames<=0) eof = PT_NEXT_ENTRY;
     }
 
 /*========================== PLAY AUDIO ============================*/