From 7bf229267d97e536fe4c7c7d09764b90e89e36cd Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 6 Mar 2013 12:05:40 -0600 Subject: [PATCH] Making a fix so that video codec name switched from "vp8 video" to "vp8" "vp8 video" is what vp8 is marked as in gstreamer's metadata. However, the browser expects it just as the name "vp8". So fixing that. This commit sponsored by Tyng-Ruey Chuang. Thank you! --- mediagoblin/media_types/video/models.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mediagoblin/media_types/video/models.py b/mediagoblin/media_types/video/models.py index 970ceb75..f696a892 100644 --- a/mediagoblin/media_types/video/models.py +++ b/mediagoblin/media_types/video/models.py @@ -78,10 +78,17 @@ class VideoData(Base): mimetype = "video/ogg" else: mimetype = orig_metadata['mimetype'] + + video_codec = orig_metadata["tags"]["video-codec"].lower() + audio_codec = orig_metadata["tags"]["audio-codec"].lower() + + # We don't want the "video" at the end of vp8... + # not sure of a nicer way to be cleaning this stuff + if video_codec == "vp8 video": + video_codec = "vp8" + return '%s; codecs="%s, %s"' % ( - mimetype, - orig_metadata["tags"]["video-codec"].lower(), - orig_metadata["tags"]["audio-codec"].lower()) + mimetype, video_codec, audio_codec) else: return video.MEDIA_MANAGER["default_webm_type"]