From 5d18e2d6e9b3ebc6f1668fe8cd16f0925f9acab2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 22 Mar 2012 00:04:35 +0100 Subject: [PATCH] if source has 2 audio channels. use first one --- pandora_client/extract.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_client/extract.py b/pandora_client/extract.py index ff2c280..325b423 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -148,11 +148,12 @@ def video_cmd(video, target, profile, info): if info['audio']: audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] - ac = 1 - for a in info['audio']: - ac = max(ac, a.get('channels', 1)) - if audiochannels and ac >= audiochannels: - audio_settings += ['-ac', str(audiochannels)] + if len(info['audio'][0]) > 1 and info['video']: + audio_settings += ['-map', '0:0'] + audio_settings += ['-map', '0:1'] + ac = info['audio'][0].get('channels', audiochannels) + ac = min(ac, audiochannels) + audio_settings += ['-ac', str(ac)] if audiobitrate: audio_settings += ['-ab', audiobitrate] audio_settings +=['-acodec', 'libvorbis']