Skip to content

Commit

Permalink
bw/hooks/encoders_test_voctocore_config: ensure we always have "stere…
Browse files Browse the repository at this point in the history
…o" audio
  • Loading branch information
Kunsi committed Jun 26, 2024
1 parent 48b071f commit c4a4bb4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bundlewrap/hooks/encoders_test_voctocore_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def run_test(node):
if not sname == 'slides' and not match(r'^cam[0-9]+$', sname):
raise BundleError(f'{node.name}: voctocore source {sname} has invalid name, must be either "slides" or match "cam[0-9]+"')

device = str(sconfig['devicenumber'])
device = str(sconfig.get('devicenumber'))
if not device.isdigit():
raise BundleError(f'{node.name}: voctocore source {sname} has invalid device number {device}')
elif device in used_devices:
Expand All @@ -108,10 +108,18 @@ def run_test(node):
if aconfig['input'] not in node.metadata.get('voctocore/sources', {}):
raise BundleError(f'{node.name}: voctocore audio {aname} wants input {aconfig["input"]}, which doesn\'t exist')

audio_name = f'{aconfig["input"]} {aconfig["streams"]}'
if audio_name in used_audio:
raise BundleError(f'{node.name}: voctocore audio {aname} wants input {audio_name}, which is already used by {used_audio[audio_name]}')
used_audio[audio_name] = aname
if not match(r'^\d+\+\d+$', aconfig['streams']):
if aconfig['streams'].isdigit():
raise BundleError(f'{node.name}: voctocore audio {aname} is not in required format "{aconfig["streams"]}+{aconfig["streams"]}".')
raise BundleError(f'{node.name}: voctocore audio {aname} is not in required format "X+X" (X being a SDI stream number).')

for stream in aconfig['streams'].split('+'):
audio_name = f'{aconfig["input"]} {stream}'
if audio_name in used_audio:
raise BundleError(f'{node.name}: voctocore audio {aname} wants input {audio_name}, which is already used by {used_audio[audio_name]}')

for stream in aconfig['streams'].split('+'):
used_audio[f'{aconfig["input"]} {stream}'] = aname

for pname, pdevice in node.metadata.get('voctocore/playout', {}).items():
device = str(pdevice)
Expand Down

0 comments on commit c4a4bb4

Please sign in to comment.