From ca299e50222432aae644a03629307265032adef4 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 8 Feb 2013 18:09:16 +0530 Subject: [PATCH] fix encoding of audio only files --- pandora_client/extract.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_client/extract.py b/pandora_client/extract.py index 375003f..b964f15 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -225,7 +225,10 @@ def video_cmd(video, target, profile, info): video_settings = ['-vn'] if info['audio']: - n = video_settings == ['-vn'] and 0 or 1 + if video_settings == ['-vn'] or not info['video']: + n = 0 + else: + n = 1 video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)] audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] ac = info['audio'][0].get('channels', audiochannels)