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"
This commit is contained in:
ayleph 2015-11-17 23:56:31 -05:00 committed by Christopher Allan Webber
parent 17eb7786b6
commit ba6d2d7e78

View File

@ -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: