UI: Make audio_configurations.vod optional

This is only required if VOD is supported by the service and VOD
track is enabled; otherwise there's no need to supply the key
or an empty array
This commit is contained in:
Ruwen Hahn 2024-06-14 15:42:04 +02:00 committed by Ryan Foster
parent 021adac2d0
commit 40bf8b3c06
2 changed files with 4 additions and 2 deletions

View file

@ -279,7 +279,7 @@ struct AudioEncoderConfiguration {
struct AudioConfigurations {
std::vector<AudioEncoderConfiguration> live;
std::vector<AudioEncoderConfiguration> vod;
optional<std::vector<AudioEncoderConfiguration>> vod;
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(AudioConfigurations, live,
vod)

View file

@ -777,8 +777,10 @@ create_audio_encoders(const GoLiveApi::Config &go_live_config,
if (!vod_track_mixer.has_value())
return;
// we already check for empty inside of `create_encoders`
encoder_configs_type empty = {};
create_encoders("multitrack video vod audio",
go_live_config.audio_configurations.vod,
go_live_config.audio_configurations.vod.value_or(empty),
*vod_track_mixer);
return;