summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-24 20:09:31 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 22:48:10 +0300
commita2133d76847dd4c7a19d6826cd9a6562bedfdbc4 (patch)
tree84d45683615f51b73c624f51ad62f46247ccedfc /mencoder.c
parent9c63c084ff589de88ddf26c64a074cdac0eca046 (diff)
downloadmpv-a2133d76847dd4c7a19d6826cd9a6562bedfdbc4.tar.bz2
mpv-a2133d76847dd4c7a19d6826cd9a6562bedfdbc4.tar.xz
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.
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c8
1 files changed, 4 insertions, 4 deletions
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;
}