Skip to content

Commit c5395fe

Browse files
committed
DeckLink drift fixer: set SoxR as default
1 parent 4b0b796 commit c5395fe

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/video_display/decklink.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ static bool settings_init(struct state_decklink *s, const char *fmt,
10641064
} else if (strstr(ptr, "keep-settings") == ptr) {
10651065
s->keep_device_defaults = true;
10661066
} else if (strstr(ptr, "drift_fix") == ptr) {
1067-
s->audio_drift_fixer.m_enabled = true;
1067+
s->audio_drift_fixer.enable();
10681068
} else if (strncasecmp(ptr, "maxresample=", strlen("maxresample=")) == 0) {
10691069
s->audio_drift_fixer.set_max_hz(parse_uint32(strchr(ptr, '=') + 1));
10701070
} else if (strncasecmp(ptr, "minresample=", strlen("minresample=")) == 0) {

src/video_display/decklink_drift_fix.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#include <string>
4343

44+
#include "host.h"
4445
#include "utils/color_out.h"
4546

4647
#define MAX_RESAMPLE_DELTA_DEFAULT 30
@@ -299,8 +300,13 @@ class DecklinkAudioSummary {
299300
*/
300301
class AudioDriftFixer {
301302
public:
302-
bool m_enabled = false;
303-
303+
void enable() {
304+
m_enabled = true;
305+
if (commandline_params.find("resampler") == commandline_params.end()) {
306+
LOG(LOG_LEVEL_INFO) << MOD_NAME << "Using SoxR resampler by default when DecKlink audio drift fixer is enabled.\n";
307+
commandline_params["resampler"] = "soxr";
308+
}
309+
}
304310
/**
305311
* @brief Set the max hz object
306312
*
@@ -450,6 +456,8 @@ class AudioDriftFixer {
450456
}
451457

452458
private:
459+
bool m_enabled = false;
460+
453461
static constexpr unsigned long BASE = (1U<<8U);
454462
struct module *m_root = nullptr;
455463

0 commit comments

Comments
 (0)