From ba6d2d7e7842b42e5dee7cc48c8729aa020f6c94 Mon Sep 17 00:00:00 2001 From: ayleph Date: Tue, 17 Nov 2015 23:56:31 -0500 Subject: [PATCH] Fix for issue 5070 gst incomplete file Seek tmp_media_file to 0 before attempting to discover the file type. This prevents the following error when discovering mp4 video files. "gst-stream-error-quark: This file is incomplete and cannot be played" --- mediagoblin/media_types/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mediagoblin/media_types/__init__.py b/mediagoblin/media_types/__init__.py index 97e4facd..9f6043e9 100644 --- a/mediagoblin/media_types/__init__.py +++ b/mediagoblin/media_types/__init__.py @@ -146,6 +146,7 @@ def sniff_media(media_file, filename): tmp_media_file = tempfile.NamedTemporaryFile() shutil.copyfileobj(media_file, tmp_media_file) media_file.seek(0) + tmp_media_file.seek(0) try: return type_match_handler(tmp_media_file, filename) except TypeNotFound as e: -- 2.25.1