]> git.parisson.com Git - timeside.git/commitdiff
Add sha1 argument in FileDecoder
authorThomas Fillon <thomas@parisson.com>
Tue, 29 Apr 2014 09:55:15 +0000 (11:55 +0200)
committerThomas Fillon <thomas@parisson.com>
Tue, 29 Apr 2014 09:55:15 +0000 (11:55 +0200)
timeside/decoder/file.py

index 62d8ecf995e1568d095e136ac71d9af587fe3ec2..88bedc1b995abcb96b35acf96b6e411bcec12b1c 100644 (file)
@@ -50,7 +50,7 @@ class FileDecoder(Decoder):
     def id():
         return "gst_dec"
 
-    def __init__(self, uri, start=0, duration=None, stack=False):
+    def __init__(self, uri, start=0, duration=None, stack=False, sha1=None):
         """
         Construct a new FileDecoder
 
@@ -71,7 +71,11 @@ class FileDecoder(Decoder):
         self.stack = stack
 
         self.uri = get_uri(uri)
-        self._sha1 = get_sha1(uri)
+
+        if not sha1:
+            self._sha1 = get_sha1(uri)
+        else:
+            self._sha1 = sha1
 
         self.uri_total_duration = get_media_uri_info(self.uri)['duration']