diff options
author | ayleph <ayleph@thisshitistemp.com> | 2015-11-17 23:56:31 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-11-19 16:05:25 -0600 |
commit | ba6d2d7e7842b42e5dee7cc48c8729aa020f6c94 (patch) | |
tree | 68fcdad440301f0f2a880251e060d51db526fcf2 | |
parent | 17eb7786b68c528085fb93f0d6bfd289153e485e (diff) | |
download | mediagoblin-ba6d2d7e7842b42e5dee7cc48c8729aa020f6c94.tar.lz mediagoblin-ba6d2d7e7842b42e5dee7cc48c8729aa020f6c94.tar.xz mediagoblin-ba6d2d7e7842b42e5dee7cc48c8729aa020f6c94.zip |
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"
-rw-r--r-- | mediagoblin/media_types/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
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: |