summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvd.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 /stream/stream_dvd.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 'stream/stream_dvd.c')
-rw-r--r--stream/stream_dvd.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index d1a91f88c1..a006047871 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -83,42 +83,6 @@ static const struct m_struct_st stream_opts = {
stream_opts_fields
};
-int dvd_parse_chapter_range(const m_option_t *conf, const char *range) {
- const char *s;
- char *t;
- if (!range)
- return M_OPT_MISSING_PARAM;
- s = range;
- dvd_chapter = 1;
- dvd_last_chapter = 0;
- if(*range && isdigit(*range)) {
- dvd_chapter = strtol(range, &s, 10);
- if(range == s) {
- mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return M_OPT_INVALID;
- }
- }
- if(*s == 0)
- return 0;
- else if(*s != '-') {
- mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return M_OPT_INVALID;
- }
- ++s;
- if(*s == 0)
- return 0;
- if(! isdigit(*s)) {
- mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return M_OPT_INVALID;
- }
- dvd_last_chapter = strtol(s, &t, 10);
- if (s == t || *t) {
- mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return M_OPT_INVALID;
- }
- return 0;
-}
-
int dvd_chapter_from_cell(dvd_priv_t* dvd,int title,int cell)
{
pgc_t * cur_pgc;
@@ -411,8 +375,6 @@ static void dvd_close(dvd_priv_t *d) {
ifoClose(d->vmg_file);
DVDCloseFile(d->title);
DVDClose(d->dvd);
- dvd_chapter = 1;
- dvd_last_chapter = 0;
dvd_set_speed(dvd_device_current, -1); /* -1 => restore default */
}