From e5ab09bb64448e8d60f081891fb85d742c83c9a0 Mon Sep 17 00:00:00 2001 From: uau Date: Sat, 24 Feb 2007 07:11:57 +0000 Subject: 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 --- mencoder.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'mencoder.c') 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 -- cgit v1.2.3