when using -ss:

"seek seconds" -> "super seek"
now it understands 1:22:41.4   2:13   style time


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@938 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
laaz 2001-06-01 22:48:50 +00:00
parent d1e5e3c58b
commit d2291f791c
3 changed files with 16 additions and 7 deletions

View File

@ -71,7 +71,7 @@ struct config conf[]={
{"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1},
{"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0},
{"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0},
{"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0},
{"ss", &seek_to_sec, CONF_TYPE_STRING, CONF_MIN, 0, 0},
{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
{"abs", &audio_buffer_size, CONF_TYPE_INT, CONF_MIN, 0, 0},

View File

@ -445,7 +445,7 @@ extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
char* filename=NULL; //"MI2-Trailer.avi";
int i;
int seek_to_sec=0;
char *seek_to_sec=NULL;
int seek_to_byte=0;
int f; // filedes
stream_t* stream=NULL;
@ -513,7 +513,7 @@ int osd_visible=100;
int osd_function=OSD_PLAY;
int osd_last_pts=-303;
int rel_seek_secs=0;
float rel_seek_secs=0;
#include "mixer.h"
#include "cfg-mplayer.h"
@ -2155,9 +2155,18 @@ switch(sh_video->codec->driver){
break;
}
if (seek_to_sec) {
rel_seek_secs += seek_to_sec;
seek_to_sec = 0;
int a,b; float d;
if (sscanf(seek_to_sec, "%d:%d:%f", &a,&b,&d)==3)
rel_seek_secs += 3600*a +60*b +d ;
else if (sscanf(seek_to_sec, "%d:%f", &a, &d)==2)
rel_seek_secs += 60*a +d;
else if (sscanf(seek_to_sec, "%f", &d)==1)
rel_seek_secs += d;
seek_to_sec = NULL;
}
if(rel_seek_secs)
if(file_format==DEMUXER_TYPE_AVI && demuxer->idx_size<=0){
printf("Can't seek in raw .AVI streams! (index required, try with the -idx switch!) \n");

View File

@ -6,7 +6,7 @@ extern int divx_quality;
extern char* filename;
extern int i;
extern int seek_to_sec;
extern char *seek_to_sec;
extern int seek_to_byte;
extern int f; // filedes
extern int stream_type;
@ -70,7 +70,7 @@ extern int verbose;
extern int osd_level;
extern int nogui;
extern int rel_seek_secs;
extern float rel_seek_secs;
extern int osd_visible;
extern int osd_function;