]> code.delx.au - transcoding/commitdiff
Fixed incorrect file extension for --copyac3
authorJames Bunton <jamesbunton@fastmail.fm>
Sat, 31 Jul 2010 09:13:07 +0000 (19:13 +1000)
committerJames Bunton <jamesbunton@fastmail.fm>
Sat, 31 Jul 2010 09:13:07 +0000 (19:13 +1000)
encode.py

index c788bb632d8df67107b85633068dfe5d61a4289e..2f83bc9682f0aa18919d1f47b0f8453cebffd467 100755 (executable)
--- a/encode.py
+++ b/encode.py
@@ -57,9 +57,13 @@ class Command(object):
        def __init__(self, profile, opts):
                self.profile = profile
                self.opts = opts
+               self.init()
                self.audio_tmp = "audio." + self.codec2exts[profile.acodec]
                self.video_tmp = "video." + self.codec2exts[profile.vcodec]
-       
+
+       def init(self):
+               pass
+
        def print_install_message(self):
                print >>sys.stderr, "Problem with command: %s", self.name
                if self.package:
@@ -151,6 +155,11 @@ class Mencoder(Command):
                "mp3lame": "-lameopts",
        }
 
+       def init(self):
+               if self.opts.copyac3:
+                       self.profile.acodec = "copyac3"
+                       self.profile.aopts = None
+
        def insert_options(self, cmd):
                def try_opt(opt, var):
                        if var is not None:
@@ -186,10 +195,8 @@ class Mencoder(Command):
                p = self.profile
 
                acodec = p.acodec
-               if self.opts.copyac3:
+               if acodec == "copyac3":
                        acodec = "copy"
-                       p.acodec = "copyac3"
-                       p.aopts = None
 
                cmd = []
                cmd += ["mencoder", self.opts.input]