diff stream/stream_dvd.c @ 36080:a5fd69f820f3

Make -chapter always available, even when compiled without DVD support. Patch by Olivier Rolland [billl users.sourceforge.net].
author reimar
date Fri, 26 Apr 2013 19:43:01 +0000
parents 389d43c448b3
children e6823a005ab6
line wrap: on
line diff
--- a/stream/stream_dvd.c	Fri Apr 26 19:19:34 2013 +0000
+++ b/stream/stream_dvd.c	Fri Apr 26 19:43:01 2013 +0000
@@ -16,7 +16,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -85,42 +84,6 @@
   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, (char **) &s, 10);
-    if(range == s) {
-      mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
-      return M_OPT_INVALID;
-    }
-  }
-  if(*s == 0)
-    return 0;
-  else if(*s != '-') {
-    mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
-    return M_OPT_INVALID;
-  }
-  ++s;
-  if(*s == 0)
-      return 0;
-  if(! isdigit(*s)) {
-    mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
-    return M_OPT_INVALID;
-  }
-  dvd_last_chapter = strtol(s, &t, 10);
-  if (s == t || *t) {
-    mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
-    return M_OPT_INVALID;
-  }
-  return 0;
-}
-
 int dvd_chapter_from_cell(dvd_priv_t* dvd,int title,int cell)
 {
   pgc_t * cur_pgc;