[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.33,1.34 stream.h,1.29,1.30

Kim Minh Kaplan CVS kmkaplan at mplayer.dev.hu
Fri Jan 25 00:03:01 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv23621/libmpdemux

Modified Files:
	open.c stream.h 
Log Message:
Extended DVD chapter specification.  Remove -last-chapter option.


Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- open.c	21 Jan 2002 09:44:25 -0000	1.33
+++ open.c	24 Jan 2002 23:02:50 -0000	1.34
@@ -1,4 +1,5 @@
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -13,6 +14,7 @@
 #include <sys/cdrio.h>
 #endif
 
+#include "../cfgparser.h"
 #include "stream.h"
 #include "demuxer.h"
 
@@ -419,6 +421,38 @@
        stream->end_pos=len;
        return stream;
 
+}
+
+int dvd_parse_chapter_range(struct config *conf, const char *range){
+  char *s, *t;
+  dvd_chapter = 1;
+  dvd_last_chapter = 0;
+  if (*range && isdigit(*range)) {
+    dvd_chapter = strtol(range, &s, 10);
+    if (range == s) {
+      mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
+      return -1;
+    }
+  }
+  if (*s == 0)
+    return 0;
+  else if (*s != '-') {
+    mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
+    return -1;
+  }
+  ++s;
+  if (*s == 0)
+      return 0;
+  if (! isdigit(*s)) {
+    mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
+    return -1;
+  }
+  dvd_last_chapter = strtol(s, &t, 10);
+  if (s == t || *t)  {
+    mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
+    return -1;
+  }
+  return 0;
 }
 
 #ifdef USE_DVDREAD

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- stream.h	23 Jan 2002 14:11:19 -0000	1.29
+++ stream.h	24 Jan 2002 23:02:50 -0000	1.30
@@ -184,6 +184,7 @@
 extern int dvd_chapter;
 extern int dvd_last_chapter;
 extern int dvd_angle;
+int dvd_parse_chapter_range(struct config*, const char*);
 //#endif
 
 #ifdef USE_DVDREAD




More information about the MPlayer-cvslog mailing list