]> git.parisson.com Git - timeside.git/commitdiff
timeside/decoder/core.py: raise discover not run exception if the file exist only
authorPaul Brossier <piem@piem.org>
Sun, 19 Aug 2012 07:01:02 +0000 (01:01 -0600)
committerPaul Brossier <piem@piem.org>
Sun, 19 Aug 2012 07:01:02 +0000 (01:01 -0600)
timeside/decoder/core.py

index 1018897c322d87db6d01522a48dc9ef2224af533..be5fab9a5ef8af9ab84698db4f9f3686130790a4 100644 (file)
@@ -55,15 +55,15 @@ class FileDecoder(Processor):
         if os.path.exists(uri):
             # get the absolute path
             uri = os.path.abspath(uri)
+            # first run the file/uri through the discover pipeline
+            self.discover(uri)
+            if not self.was_discovered:
+                raise Exception('discovered was not run')
             # and make a uri of it
             from urllib import quote
             self.uri = 'file://'+quote(uri)
         else:
             self.uri = uri
-        # first run the file/uri through the discover pipeline
-        self.discover(uri)
-        if not self.was_discovered:
-            raise Exception('discovered was not run')
 
     def setup(self, channels = None, samplerate = None, nframes = None):
         # the output data format we want