avinfo should not fail for emptpy files
This commit is contained in:
parent
70f9fc2b6f
commit
a5a2780525
1 changed files with 5 additions and 4 deletions
|
@ -60,7 +60,8 @@ def oshash(filename):
|
||||||
return "IOError"
|
return "IOError"
|
||||||
|
|
||||||
def avinfo(filename):
|
def avinfo(filename):
|
||||||
|
if os.path.getsize(filename):
|
||||||
p = subprocess.Popen(['ffmpeg2theora', '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(['ffmpeg2theora', '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
info, error = p.communicate()
|
info, error = p.communicate()
|
||||||
return simplejson.loads(info)
|
return simplejson.loads(info)
|
||||||
|
return {'path': filename, 'size': 0}
|
||||||
|
|
Loading…
Reference in a new issue