Skip to content

Commit

Permalink
vspreview/core/types.py: fix after introducing VideoOutputTuple
Browse files Browse the repository at this point in the history
and always returning VideoOutputTuple from vs.get_outputs() in the
latest doodle1 branch.

Signed-off-by: akarin <[email protected]>
  • Loading branch information
AkarinVS committed Sep 2, 2021
1 parent 6c27018 commit e1f7fda
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions vspreview/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e1f7fda

Please sign in to comment.