[MPlayer-dev-eng] [Patch] mencoder: enhance -endpos accuracy for time values

eviv bulgroz ebulgroz at yahoo.com
Sat Nov 23 17:23:58 CET 2002


Hi 
Current mencoder -endpos implementation is sometime off by several seconds for large time values.
This patch enhances endpos time accuracy, and also allows the use of "ms" time values.

# cvs diff -u main/mencoder.c main/DOCS/mplayer.1 
Index: main/mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.185
diff -u -r1.185 mencoder.c
--- main/mencoder.c	12 Nov 2002 01:56:21 -0000	1.185
+++ main/mencoder.c	23 Nov 2002 16:39:52 -0000
@@ -286,7 +286,7 @@
 
 enum end_at_type_t {END_AT_NONE, END_AT_TIME, END_AT_SIZE};
 static enum end_at_type_t end_at_type = END_AT_NONE;
-static int end_at;
+static double end_at;
 
 static void exit_sighandler(int x){
     at_eof=1;
@@ -872,7 +872,7 @@
     int skip_flag=0; // 1=skip  -1=duplicate
 
     if((end_at_type == END_AT_SIZE && end_at <= ftello(muxer_f))  ||
-       (end_at_type == END_AT_TIME && end_at < sh_video->timer))
+       (end_at_type == END_AT_TIME && end_at <= mux_v->timer))
         break;
 
     if(play_n_frames>=0){
Index: main/DOCS/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/mplayer.1,v
retrieving revision 1.269
diff -u -r1.269 mplayer.1
--- main/DOCS/mplayer.1	22 Nov 2002 08:23:20 -0000	1.269
+++ main/DOCS/mplayer.1	23 Nov 2002 16:40:01 -0000
@@ -1993,7 +1993,7 @@
 .RE
 .
 .TP
-.B \-endpos <time|byte\ position> (see \-ss and \-sb option too)
+.B \-endpos <[[hh:]mm:]ss[.ms]|size[b|kb|mb]> (see \-ss and \-sb option too)
 Stop encoding at given time or byte position.
 Can be specified in many ways:
 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the MPlayer-dev-eng mailing list