From b648aafe9e4b9ce32a4c17f496bb926bf2fc99ed Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 1 Oct 2012 01:27:41 +0200 Subject: refactoring --- src/flufigut.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/flufigut.py b/src/flufigut.py index 4007e4f..d8cbaa9 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -120,8 +120,15 @@ for property in input.keys(): elif property != 'source': flow['input']['raw-input']['properties'][property] = input[property] + +samplerates = [ ] resolutions = [ ] for format in transcode.keys(): + if 'samplerate' in globals['formats'][format]: + samplerate = globals['formats'][format]['samplerate'] + if samplerate not in samplerates: + if input['samplerate'] != samplerate: + samplerates.append(samplerate) for profile in transcode[format]: resolution = globals['profiles'][profile]['video'] if resolution not in resolutions: @@ -143,15 +150,6 @@ for resolution in resolutions: }, } - -samplerates = [ ] -for format in globals['formats'].keys(): - if 'samplerate' in globals['formats'][format]: - samplerate = globals['formats'][format]['samplerate'] - if samplerate not in samplerates: - if input['samplerate'] != samplerate: - samplerates.append(samplerate) - for samplerate in samplerates: flow['input']['resample-%s' % samplerate] = { 'type': 'audio-resample', -- cgit v1.2.3