diff --git a/src/transcription-filter.cpp b/src/transcription-filter.cpp index 0d35d08..43959e3 100644 --- a/src/transcription-filter.cpp +++ b/src/transcription-filter.cpp @@ -101,10 +101,11 @@ const char *transcription_filter_name(void *unused) void transcription_filter_destroy(void *data) { + obs_log(LOG_INFO, "transcription_filter_destroy"); + struct transcription_filter_data *gf = static_cast(data); - obs_log(LOG_INFO, "transcription_filter_destroy"); { std::lock_guard lock(*gf->whisper_ctx_mutex); if (gf->whisper_context != nullptr) { @@ -205,10 +206,16 @@ void set_text_callback(struct transcription_filter_data *gf, const std::string & void transcription_filter_update(void *data, obs_data_t *s) { + obs_log(LOG_INFO, "transcription_filter_update"); + + if (!data) { + obs_log(LOG_ERROR, "transcription_filter_update: data is null"); + return; + } + struct transcription_filter_data *gf = static_cast(data); - obs_log(LOG_INFO, "transcription_filter_update"); gf->log_level = (int)obs_data_get_int(s, "log_level"); gf->vad_enabled = obs_data_get_bool(s, "vad_enabled"); gf->log_words = obs_data_get_bool(s, "log_words"); @@ -343,7 +350,7 @@ void transcription_filter_update(void *data, obs_data_t *s) void *transcription_filter_create(obs_data_t *settings, obs_source_t *filter) { struct transcription_filter_data *gf = static_cast( - bmalloc(sizeof(struct transcription_filter_data))); + bzalloc(sizeof(struct transcription_filter_data))); // Get the number of channels for the input source gf->channels = audio_output_get_channels(obs_get_audio()); diff --git a/src/whisper-processing.cpp b/src/whisper-processing.cpp index be21906..7465a5a 100644 --- a/src/whisper-processing.cpp +++ b/src/whisper-processing.cpp @@ -72,6 +72,7 @@ bool vad_simple(float *pcmf32, size_t pcm32f_size, uint32_t sample_rate, float v struct whisper_context *init_whisper_context(const std::string &model_path) { + obs_log(LOG_INFO, "Loading whisper model from %s", model_path.c_str()); struct whisper_context *ctx = whisper_init_from_file(obs_module_file(model_path.c_str())); if (ctx == nullptr) { obs_log(LOG_ERROR, "Failed to load whisper model");