[pitivi: 90/94] ui: Do not show preset when some gst elements are missing
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 90/94] ui: Do not show preset when some gst elements are missing
- Date: Sun, 11 Sep 2011 16:20:00 +0000 (UTC)
commit 07daa6417a325e8680cdde48b9b5268d4e8ad9a4
Author: Thibault Saunier <thibault saunier collabora com>
Date: Sat Sep 10 16:49:20 2011 -0300
ui: Do not show preset when some gst elements are missing
pitivi/ui/preset.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/preset.py b/pitivi/ui/preset.py
index fa3e694..a892722 100644
--- a/pitivi/ui/preset.py
+++ b/pitivi/ui/preset.py
@@ -25,6 +25,8 @@ import os.path
import gst
import gtk
+from pitivi.encode import available_muxers, available_video_encoders, \
+ available_audio_encoders
from pitivi.settings import xdg_data_home
from pitivi.utils import isWritable
from pitivi.configure import get_data_dir, get_renderpresets_dir, \
@@ -373,6 +375,12 @@ class RenderPresetManager(PresetManager):
acodec = parser["acodec"]
vcodec = parser["vcodec"]
+ if (acodec not in [fact.get_name() for fact in available_audio_encoders()] or
+ vcodec not in [fact.get_name() for fact in available_video_encoders()] or
+ container not in [fact.get_name() for fact in available_muxers()]):
+
+ return
+
try:
width = parser["width"]
height = parser["height"]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]