-fix infinite loop on invalid files
This commit is contained in:
parent
fc6742869f
commit
d79bfaaef9
|
@ -41,13 +41,17 @@ class SilanAnalyzer(Thread):
|
||||||
full_path = f['fp']
|
full_path = f['fp']
|
||||||
# silence detect(set default queue in and out)
|
# silence detect(set default queue in and out)
|
||||||
try:
|
try:
|
||||||
|
data = {}
|
||||||
command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path]
|
command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path]
|
||||||
|
try:
|
||||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||||
out = proc.communicate()[0].strip('\r\n')
|
out = proc.communicate()[0].strip('\r\n')
|
||||||
info = json.loads(out)
|
info = json.loads(out)
|
||||||
data = {}
|
|
||||||
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
|
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
|
||||||
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
||||||
|
except Exception, e:
|
||||||
|
self.logger.error(str(command))
|
||||||
|
self.logger.error(e)
|
||||||
processed_data.append((f['id'], data))
|
processed_data.append((f['id'], data))
|
||||||
total += 1
|
total += 1
|
||||||
if total % 5 == 0:
|
if total % 5 == 0:
|
||||||
|
|
Loading…
Reference in New Issue