From f7654508640a2042270a6904be37640393dea27c Mon Sep 17 00:00:00 2001 From: Sergio Costas Date: Fri, 16 Jan 2015 01:30:44 +0100 Subject: [PATCH] Now doesn't fail with AVPROBE or FFPROBE if a file doesn't have streams --- README.md | 3 +++ src/devede/avprobe.py | 3 +++ src/devede/configuration_data.py | 2 +- src/devede/ffprobe.py | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a51582f..ffec678 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,9 @@ Some of the future ideas to add to Devede NG are, without an specific order: ## History of versions ## +* version 0.1 beta 9 (2015-01-16) + * Now doesn't fail with AVPROBE or FFPROBE if a file doesn't have streams + * version 0.1 beta 8 (2014-12-28) * Added an extra fix for AVPROBE and FFPROBE, using the human readable strings to get the duration * Cleaner code for AVPROBE and FFPROBE diff --git a/src/devede/avprobe.py b/src/devede/avprobe.py index ae4bd2b..8addf89 100644 --- a/src/devede/avprobe.py +++ b/src/devede/avprobe.py @@ -88,6 +88,9 @@ class avprobe(devede.executor.executor): except: return True # There was an error reading the JSON data + if not("streams" in video_data): + return True # There are no streams!!!!! + for element in video_data["streams"]: if (self.original_length == -1) and ("duration" in element): diff --git a/src/devede/configuration_data.py b/src/devede/configuration_data.py index 72c8bb2..98a9737 100644 --- a/src/devede/configuration_data.py +++ b/src/devede/configuration_data.py @@ -35,7 +35,7 @@ class configuration(GObject.GObject): def __init__(self): GObject.GObject.__init__(self) - self.version = "0.1 Beta 8" + self.version = "0.1 Beta 9" def fill_config(self): diff --git a/src/devede/ffprobe.py b/src/devede/ffprobe.py index ea5a6e2..7921eaf 100644 --- a/src/devede/ffprobe.py +++ b/src/devede/ffprobe.py @@ -88,6 +88,9 @@ class ffprobe(devede.executor.executor): except: return True # There was an error reading the JSON data + if not("streams" in video_data): + return True # There are no streams!!!!! + for element in video_data["streams"]: if (self.original_length == -1) and ("duration" in element):