--- flashvideo_streaming.module	2009-02-15 01:13:58.000000000 +0100
+++ new_flashvideo_streaming.module	2009-02-17 14:10:42.000000000 +0100
@@ -116,12 +116,17 @@ function _flashvideo_streaming_admin_val
     // Set the path to the streamer based on if they want to use the Drupal root or not.
     $useroot = $form_state['values']['flashvideo_'. $node_type .'_xmoov_userootpath'];
     $user_path = $form_state['values']['flashvideo_'. $node_type .'_xmoov_path'];
-    $xmoov_path = $useroot ? base_path() . $user_path : file_directory_path() .'/'. $user_path;
+    $xmoov_path = $useroot ? $user_path : file_directory_path() .'/'. $user_path;
 
     // If we are using xmoov-php, check the xmoov path to make sure it exists.
-    if (!file_exists(getcwd() . $xmoov_path)) {
+    if (($useroot && !file_exists(getcwd() ."/". $xmoov_path))  || (!$useroot && !file_exists(realpath($xmoov_path)))) {
       form_set_error('flashvideo_'. $node_type .'_xmoov_path', "Can not find xmoov-php at ". $xmoov_path);
     }
+    
+    if($useroot) {
+      $xmoov_path = base_path().$user_path;
+    }
+    
     $form_state['values']['flashvideo_'. $node_type .'_streamer'] = $xmoov_path;
     $form_state['values']['flashvideo_'. $node_type .'_xmoov_path'] = $user_path;
   }
@@ -172,7 +177,6 @@ function flashvideo_streaming_flashvideo
  * Returns an alternate filepath, pointing to the file on the streaming server.
  */
 function flashvideo_streaming_flashvideo_get_file($file, $node_type) {
-
   // Get the filename for the file on the streaming server.
   $filename = basename($file->filepath);
 
@@ -199,7 +203,7 @@ function flashvideo_streaming_flashvideo
   }
   // xmoov-php process:
   elseif (flashvideo_variable_get($node_type, 'streaming_enable', 0) && flashvideo_variable_get($node_type, 'streaming_method', 0) == FLASHVIDEO_STREAMING_METHOD_XMOOV) {
-    if (!variable_get('flashvideo_xmoov_path', 0)) {
+    if (!flashvideo_variable_get($node_type,  'xmoov_path', 0)) {
       return array(); // User doesn't want to do streaming "gets".
     }
 
@@ -213,6 +217,7 @@ function flashvideo_streaming_flashvideo
 
       $filepath['file'] = $filename; // Finished xmoov-php filepath
     }
+    
     return $filepath;
   }
   else {
@@ -258,4 +263,4 @@ function flashvideo_streaming_flashvideo
   else {
     return array();
   }
-}
\ No newline at end of file
+}
