From 8bb0df62d45ca5f8c774180e73b6441efd4df6c8 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Thu, 15 Aug 2013 08:10:00 -0700 Subject: [PATCH] check medium_size arg in skip_transcoding, not config --- mediagoblin/media_types/video/processing.py | 7 ++++--- mediagoblin/media_types/video/util.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index fefbebfe..b91503ca 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -125,7 +125,7 @@ class CommonVideoProcessor(MediaProcessor): def common_setup(self): self.video_config = mgg \ - .global_config['media_type:mediagoblin.media_types.audio'] + .global_config['media_type:mediagoblin.media_types.video'] # Pull down and set up the original file self.orig_filename = get_orig_filename( @@ -166,7 +166,7 @@ class CommonVideoProcessor(MediaProcessor): # Figure out whether or not we need to transcode this video or # if we can skip it - if skip_transcode(metadata): + if skip_transcode(metadata, medium_size): _log.debug('Skipping transcoding') dst_dimensions = metadata['videowidth'], metadata['videoheight'] @@ -314,7 +314,8 @@ class Resizer(CommonVideoProcessor): parser.add_argument( 'file', nargs='?', - default='thumb') + default='thumb', + choices=['thumb']) return parser diff --git a/mediagoblin/media_types/video/util.py b/mediagoblin/media_types/video/util.py index 5765ecfb..c33cce5a 100644 --- a/mediagoblin/media_types/video/util.py +++ b/mediagoblin/media_types/video/util.py @@ -21,7 +21,7 @@ from mediagoblin import mg_globals as mgg _log = logging.getLogger(__name__) -def skip_transcode(metadata): +def skip_transcode(metadata, size): ''' Checks video metadata against configuration values for skip_transcode. @@ -51,9 +51,9 @@ def skip_transcode(metadata): return False if config['dimensions_match']: - if not metadata['videoheight'] <= medium_config['max_height']: + if not metadata['videoheight'] <= size[1]: return False - if not metadata['videowidth'] <= medium_config['max_width']: + if not metadata['videowidth'] <= size[0]: return False return True -- 2.25.1