diff --git a/src/video_display.c b/src/video_display.c index 8da8067c9..87c74f07d 100644 --- a/src/video_display.c +++ b/src/video_display.c @@ -66,8 +66,9 @@ #include "lib_common.h" #include "module.h" #include "tv.h" -#include "utils/thread.h" #include "utils/color_out.h" +#include "utils/macros.h" +#include "utils/thread.h" #include "video.h" #include "video_display.h" #include "video_display/splashscreen.h" @@ -611,6 +612,23 @@ struct video_frame *get_splashscreen() return frame; } +const char * +get_audio_conn_flag_name(int audio_init_flag) +{ + switch (audio_init_flag) { + case 0: + return "(none)"; + case DISPLAY_FLAG_AUDIO_EMBEDDED: + return "embedeed"; + case DISPLAY_FLAG_AUDIO_AESEBU: + return "AES/EBU"; + case DISPLAY_FLAG_AUDIO_ANALOG: + return "analog"; + default: + UG_ASSERT(0 && "Wrong audio flag!"); + } +} + void dev_add_option(struct device_info *dev, const char *name, const char *desc, const char *key, const char *opt_str, bool is_boolean){ int idx = 0; diff --git a/src/video_display.h b/src/video_display.h index f612efb20..904a90c39 100644 --- a/src/video_display.h +++ b/src/video_display.h @@ -205,7 +205,8 @@ void display_put_audio_frame(struct display *d, const struct bool display_reconfigure_audio(struct display *d, int quant_samples, int channels, int sample_rate); /** @} */ // end of display_audio -struct video_frame *get_splashscreen(void); +struct video_frame *get_splashscreen(void); +const char *get_audio_conn_flag_name(int audio_init_flag); #ifdef __cplusplus } diff --git a/src/video_display/decklink.cpp b/src/video_display/decklink.cpp index 82837648c..54e957389 100644 --- a/src/video_display/decklink.cpp +++ b/src/video_display/decklink.cpp @@ -1265,11 +1265,15 @@ set_audio_props(state_decklink *s, MSG(WARNING, "Cannot get maximum auudio channels!\n"); } - auto audioConnection = (BMDAudioOutputAnalogAESSwitch) 0; + MSG(INFO, "Using audio output: %s\n", + get_audio_conn_flag_name(audio_output)); + + /* Actually no action is required to set audio connection because BMD + * card plays audio through all its outputs (AES/SDI/analog) .... */ + BMDAudioOutputAnalogAESSwitch audioConnection{}; switch (audio_output) { case DISPLAY_FLAG_AUDIO_EMBEDDED: - audioConnection = (BMDAudioOutputAnalogAESSwitch) 0; - break; + return; case DISPLAY_FLAG_AUDIO_AESEBU: audioConnection = bmdAudioOutputSwitchAESEBU; break; @@ -1280,14 +1284,6 @@ set_audio_props(state_decklink *s, MSG(ERROR, "Unsupporetd audio connection: %d.\n", audio_output); abort(); } - LOG(LOG_LEVEL_INFO) - << MOD_NAME "Audio output set to: " - << bmd_get_audio_connection_name(audioConnection) << "\n"; - /* Actually no action is required to set audio connection because BMD - * card plays audio through all its outputs (AES/SDI/analog) .... */ - if (audioConnection == 0) { - return; - } /* .... one exception is a card that has switchable cables between * AES/EBU and analog. (But this applies only for channels 3 and above.) */