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):
|
||||||
p = subprocess.Popen(['ffmpeg2theora', '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
if os.path.getsize(filename):
|
||||||
info, error = p.communicate()
|
p = subprocess.Popen(['ffmpeg2theora', '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
return simplejson.loads(info)
|
info, error = p.communicate()
|
||||||
|
return simplejson.loads(info)
|
||||||
|
return {'path': filename, 'size': 0}
|
||||||
|
|
Loading…
Reference in a new issue