[xiph-commits] r3505 - liboggz/trunk/src/tools/oggz-chop

conrad at svn.annodex.net conrad at svn.annodex.net
Thu Feb 28 23:39:12 PST 2008


Author: conrad
Date: 2008-02-28 23:39:12 -0800 (Thu, 28 Feb 2008)
New Revision: 3505

Modified:
   liboggz/trunk/src/tools/oggz-chop/cgi.c
Log:
handle t= parameters in oggz-chop URLs, with / separating start and end time


Modified: liboggz/trunk/src/tools/oggz-chop/cgi.c
===================================================================
--- liboggz/trunk/src/tools/oggz-chop/cgi.c	2008-02-29 07:31:40 UTC (rev 3504)
+++ liboggz/trunk/src/tools/oggz-chop/cgi.c	2008-02-29 07:39:12 UTC (rev 3505)
@@ -12,11 +12,21 @@
 static void
 set_param (OCState * state, char * key, char * val)
 {
+  char * sep;
+
   if (!strncmp ("s", key, 2)) state->start = parse_timespec (val);
   if (!strncmp ("start", key, 6)) state->start = parse_timespec (val);
 
   if (!strncmp ("e", key, 2)) state->end = parse_timespec (val);
   if (!strncmp ("end", key, 6)) state->end = parse_timespec (val);
+
+  if (!strncmp ("t", key, 2)) {
+    if ((sep = strchr (val, '/')) != NULL) {
+      *sep++ = '\0';
+      state->end = parse_timespec (sep);
+    }
+    state->start = parse_timespec (val);
+  }
 }
 
 /**



More information about the commits mailing list