From e1f7fda83935a3021426c9658578b4c5e9a99c19 Mon Sep 17 00:00:00 2001 From: akarin Date: Thu, 2 Sep 2021 01:44:12 -0400 Subject: [PATCH] vspreview/core/types.py: fix after introducing VideoOutputTuple and always returning VideoOutputTuple from vs.get_outputs() in the latest doodle1 branch. Signed-off-by: akarin --- vspreview/core/types.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vspreview/core/types.py b/vspreview/core/types.py index 9cd566b..3435e6c 100644 --- a/vspreview/core/types.py +++ b/vspreview/core/types.py @@ -695,14 +695,17 @@ def __init__(self, vs_output: Union[vs.VideoNode, vs.AlphaOutputTuple], index: i # runtime attributes - if isinstance(vs_output, vs.AlphaOutputTuple): - self.has_alpha = True + if hasattr(vs, 'AlphaOutputTuple') and isinstance(vs_output, vs.AlphaOutputTuple) or \ + hasattr(vs, 'VideoOutputTuple') and isinstance(vs_output, vs.VideoOutputTuple): self.source_vs_output = vs_output.clip self.source_vs_alpha = vs_output.alpha - self.vs_alpha = self.prepare_vs_output(self.source_vs_alpha, - alpha=True) - self.format_alpha = self.source_vs_alpha.format + self.has_alpha = False + if self.source_vs_alpha: + self.has_alpha = True + self.vs_alpha = self.prepare_vs_output(self.source_vs_alpha, + alpha=True) + self.format_alpha = self.source_vs_alpha.format else: self.has_alpha = False self.source_vs_output = vs_output