ensure null strings create empty lists. Fixes #513

This commit is contained in:
clinton-hall 2014-08-01 22:04:51 +09:30
commit 2c20a5eddf

View file

@ -388,6 +388,7 @@ def initialize(section=None):
VCODEC = CFG["Transcoder"]["outputVideoCodec"].strip() VCODEC = CFG["Transcoder"]["outputVideoCodec"].strip()
VCODEC_ALLOW = CFG["Transcoder"]["VideoCodecAllow"].strip() VCODEC_ALLOW = CFG["Transcoder"]["VideoCodecAllow"].strip()
if isinstance(VCODEC_ALLOW, str): VCODEC_ALLOW = VCODEC_ALLOW.split(',') if isinstance(VCODEC_ALLOW, str): VCODEC_ALLOW = VCODEC_ALLOW.split(',')
if VCODEC_ALLOW == ['']: VCODEC_ALLOW = []
VPRESET = CFG["Transcoder"]["outputVideoPreset"].strip() VPRESET = CFG["Transcoder"]["outputVideoPreset"].strip()
try: try:
VFRAMERATE = float(CFG["Transcoder"]["outputVideoFramerate"].strip()) VFRAMERATE = float(CFG["Transcoder"]["outputVideoFramerate"].strip())
@ -399,6 +400,7 @@ def initialize(section=None):
ACODEC = CFG["Transcoder"]["outputAudioCodec"].strip() ACODEC = CFG["Transcoder"]["outputAudioCodec"].strip()
ACODEC_ALLOW = CFG["Transcoder"]["AudioCodecAllow"].strip() ACODEC_ALLOW = CFG["Transcoder"]["AudioCodecAllow"].strip()
if isinstance(ACODEC_ALLOW, str): ACODEC_ALLOW = ACODEC_ALLOW.split(',') if isinstance(ACODEC_ALLOW, str): ACODEC_ALLOW = ACODEC_ALLOW.split(',')
if ACODEC_ALLOW == ['']: ACODEC_ALLOW = []
try: try:
ACHANNELS = int(CFG["Transcoder"]["outputAudioChannels"].strip()) ACHANNELS = int(CFG["Transcoder"]["outputAudioChannels"].strip())
except: pass except: pass
@ -408,6 +410,7 @@ def initialize(section=None):
ACODEC2 = CFG["Transcoder"]["outputAudioTrack2Codec"].strip() ACODEC2 = CFG["Transcoder"]["outputAudioTrack2Codec"].strip()
ACODEC2_ALLOW = CFG["Transcoder"]["AudioCodec2Allow"].strip() ACODEC2_ALLOW = CFG["Transcoder"]["AudioCodec2Allow"].strip()
if isinstance(ACODEC2_ALLOW, str): ACODEC2_ALLOW = ACODEC2_ALLOW.split(',') if isinstance(ACODEC2_ALLOW, str): ACODEC2_ALLOW = ACODEC2_ALLOW.split(',')
if ACODEC2_ALLOW == ['']: ACODEC2_ALLOW = []
try: try:
ACHANNELS2 = int(CFG["Transcoder"]["outputAudioTrack2Channels"].strip()) ACHANNELS2 = int(CFG["Transcoder"]["outputAudioTrack2Channels"].strip())
except: pass except: pass
@ -417,6 +420,7 @@ def initialize(section=None):
ACODEC3 = CFG["Transcoder"]["outputAudioOtherCodec"].strip() ACODEC3 = CFG["Transcoder"]["outputAudioOtherCodec"].strip()
ACODEC3_ALLOW = CFG["Transcoder"]["AudioOtherCodecAllow"].strip() ACODEC3_ALLOW = CFG["Transcoder"]["AudioOtherCodecAllow"].strip()
if isinstance(ACODEC3_ALLOW, str): ACODEC3_ALLOW = ACODEC3_ALLOW.split(',') if isinstance(ACODEC3_ALLOW, str): ACODEC3_ALLOW = ACODEC3_ALLOW.split(',')
if ACODEC3_ALLOW == ['']: ACODEC3_ALLOW = []
try: try:
ACHANNELS3 = int(CFG["Transcoder"]["outputAudioOtherChannels"].strip()) ACHANNELS3 = int(CFG["Transcoder"]["outputAudioOtherChannels"].strip())
except: pass except: pass