audio channel should never be 0

This commit is contained in:
j 2012-06-12 14:20:48 +02:00
parent 626b860a34
commit 273fcb6458

View file

@ -178,7 +178,10 @@ def video_cmd(video, target, profile, info):
video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)] video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)]
audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)]
ac = info['audio'][0].get('channels', audiochannels) ac = info['audio'][0].get('channels', audiochannels)
if ac:
ac = min(ac, audiochannels) ac = min(ac, audiochannels)
else:
ac = audiochannels
audio_settings += ['-ac', str(ac)] audio_settings += ['-ac', str(ac)]
if audiobitrate: if audiobitrate:
audio_settings += ['-ab', audiobitrate] audio_settings += ['-ab', audiobitrate]