Index: ffmpeg_wrapper.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ffmpeg_wrapper/ffmpeg_wrapper.module,v
retrieving revision 1.1.2.20.2.5
diff -u -r1.1.2.20.2.5 ffmpeg_wrapper.module
--- ffmpeg_wrapper.module	16 Nov 2008 18:21:04 -0000	1.1.2.20.2.5
+++ ffmpeg_wrapper.module	18 Nov 2008 12:25:13 -0000
@@ -522,7 +522,7 @@
   $output = ffmpeg_wrapper_run_command("-i $path");
 
   // parse the output looking for "Duration: 00:02:12"
-  $pattern = "/Duration: (.*[0-9:])(\.*[0-9]), start/";
+  $pattern = "/Duration: ([0-9]+:[0-9]+:[0-9]+)\.[0-9]+/";
   preg_match($pattern, $output, $matches);
 
   $time = $matches[1];
@@ -532,13 +532,14 @@
     // get the time into an array
     $time = explode(':', $time);
     
-    if ($time[1] != '00') {
-      $seconds = $seconds + ($time[0] * 60);
+    $seconds = 0;
+    if ($time[0] != '00') {
+      $seconds += $time[0] * 60 * 60;
     }
-    if ($time[2] != '00') {
-      $seconds = $seconds + ($time[1] * (60*60));
+    if ($time[1] != '00') {
+      $seconds += $time[1] * 60;
     }
-    $seconds = $seconds + $time[2];
+    $seconds += $time[2];
     
     $time = $seconds;
   }
