From a2133d76847dd4c7a19d6826cd9a6562bedfdbc4 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 24 Apr 2010 20:09:31 +0300 Subject: options: move -chapter values to option struct -chapter can optionally take a range with a start and an end. Add a new option type which supports such values and use that instead of a custom per-option function. This commit also fixes a build configuration bug: before the availability of the -chapter option depended on DVD functionality being enabled in the binary, even though the option works with other sources too. --- mencoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 75a458f6a4..df1c568cb9 100644 --- a/mencoder.c +++ b/mencoder.c @@ -644,9 +644,9 @@ if(stream->type==STREAMTYPE_DVDNAV){ } } - if(dvd_chapter>1) { + if(opts.chapterrange[0]>1) { double pts; - if (demuxer_seek_chapter(demuxer, dvd_chapter-1, &pts, NULL) >= 0 && pts > -1.0) + if (demuxer_seek_chapter(demuxer, opts.chapterrange[0]-1, &pts, NULL) >= 0 && pts > -1.0) seek_to_sec = pts; } @@ -1193,9 +1193,9 @@ while(!at_eof){ --play_n_frames; if(play_n_frames<0) break; } - if(dvd_last_chapter>0) { + if(opts.chapterrange[1]>0) { int cur_chapter = demuxer_get_current_chapter(demuxer); - if(cur_chapter!=-1 && cur_chapter+1>dvd_last_chapter) + if(cur_chapter!=-1 && cur_chapter+1>opts.chapterrange[1]) break; } -- cgit v1.2.3