diff m_option.c @ 35590:388b4cc85c0e

Allow "nopts" as time specification, it might be useful in some rare cases.
author reimar
date Sat, 15 Dec 2012 19:51:21 +0000
parents 8756cd0da7b7
children 389d43c448b3
line wrap: on
line diff
--- a/m_option.c	Sat Dec 15 19:33:19 2012 +0000
+++ b/m_option.c	Sat Dec 15 19:51:21 2012 +0000
@@ -32,6 +32,7 @@
 #include "m_option.h"
 //#include "m_config.h"
 #include "mp_msg.h"
+#include "mp_global.h"
 #include "stream/url.h"
 #include "libavutil/avstring.h"
 
@@ -1324,7 +1325,10 @@
     *time = 60*a + d;
   else if (sscanf(str, "%lf%n", &d, &len) >= 1)
     *time = d;
-  else
+  else if (strncasecmp(str, "nopts", 5) == 0) {
+    *time = MP_NOPTS_VALUE;
+    len = 5;
+  } else
     return 0; /* unsupported time format */
   if (str[len] && str[len] != endchar)
     return 0; /* invalid extra characters at the end */