summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-24 07:11:57 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-24 07:11:57 +0000
commite5ab09bb64448e8d60f081891fb85d742c83c9a0 (patch)
tree1c6bda6d0253cc0bf49516771c68a63371286acd /mplayer.c
parentac8d43dbed744f4e541184fe43e9c2a4d2ec6643 (diff)
downloadmpv-e5ab09bb64448e8d60f081891fb85d742c83c9a0.tar.bz2
mpv-e5ab09bb64448e8d60f081891fb85d742c83c9a0.tar.xz
Move parsing of the -ss option to the option code.
Also fixes a memory leak of the parameter string. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22330 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/mplayer.c b/mplayer.c
index a691bd56f2..922b36c986 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -239,7 +239,7 @@ int term_osd = 1;
static char* term_osd_esc = "\x1b[A\r\x1b[K";
static char* playing_msg = NULL;
// seek:
-static char *seek_to_sec=NULL;
+static double seek_to_sec;
static off_t seek_to_byte=0;
static off_t step_sec=0;
static int loop_times=-1;
@@ -3537,16 +3537,8 @@ if(step_sec>0) {
mpctx->was_paused = 0;
if (seek_to_sec) {
- 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;
+ rel_seek_secs += seek_to_sec;
+ seek_to_sec = 0;
}
if (end_at.type != END_AT_NONE) {