Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwurstsalat <mailtrash@posteo.de>2021-12-02 23:17:54 +0300
committerwurstsalat <mailtrash@posteo.de>2021-12-02 23:19:03 +0300
commitb8ecaea525d68c9f1f7b9deef2d9fbd8867d05fa (patch)
tree0b6e839597d89b31af032468a4f6d4b2fe9d1671
parentaaed7e46378988ebf262c218b9bc6170b10d9d75 (diff)
[preview] Check for GstPbutils
Fixes #563
-rw-r--r--url_image_preview/url_image_preview.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/url_image_preview/url_image_preview.py b/url_image_preview/url_image_preview.py
index 582c957..5c84827 100644
--- a/url_image_preview/url_image_preview.py
+++ b/url_image_preview/url_image_preview.py
@@ -29,11 +29,13 @@ from gi.repository import GdkPixbuf
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import Soup
+HAS_GSTPBUTILS = False
try:
gi.require_version('Gst', '1.0')
gi.require_version('GstPbutils', '1.0')
from gi.repository import Gst
from gi.repository import GstPbutils
+ HAS_GSTPBUTILS = True
except Exception:
pass
@@ -728,6 +730,9 @@ class UrlImagePreviewPlugin(GajimPlugin):
@staticmethod
def _contains_audio_streams(file_path):
+ if not HAS_GSTPBUTILS:
+ return False
+
# Check if it is really an audio file
has_audio = False
discoverer = GstPbutils.Discoverer()