summaryrefslogtreecommitdiffstats
path: root/mencoder.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 /mencoder.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 'mencoder.c')
-rw-r--r--mencoder.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/mencoder.c b/mencoder.c
index 1bc47508ff..b690c7563c 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -250,7 +250,7 @@ static int cfg_include(m_option_t *conf, char *filename){
return m_config_parse_config_file(mconfig, filename);
}
-static char *seek_to_sec=NULL;
+static double seek_to_sec;
static off_t seek_to_byte=0;
static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 };
@@ -1035,16 +1035,7 @@ else {
}
if (seek_to_sec) {
- int a,b; float d;
-
- if (sscanf(seek_to_sec, "%d:%d:%f", &a,&b,&d)==3)
- d += 3600*a + 60*b;
- else if (sscanf(seek_to_sec, "%d:%f", &a, &d)==2)
- d += 60*a;
- else
- sscanf(seek_to_sec, "%f", &d);
-
- demux_seek(demuxer, d, audio_delay, 1);
+ demux_seek(demuxer, seek_to_sec, audio_delay, 1);
// there is 2 way to handle the -ss option in 3-pass mode:
// > 1. do the first pass for the whole file, and use -ss for 2nd/3rd pases only
// > 2. do all the 3 passes with the same -ss value