Skip to content

Commit

Permalink
Fix crash stopping encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Apr 16, 2024
1 parent 01a1624 commit 3c42da3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else()
cmake_minimum_required(VERSION 3.18)
endif()

project(source-record VERSION 0.3.3)
project(source-record VERSION 0.3.4)
set(PROJECT_FULL_NAME "Source Record")

# Set new UUIDs when you start to create a new plugin.
Expand Down
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
}
},
"name": "source-record",
"version": "0.3.3"
"version": "0.3.4"
}
6 changes: 3 additions & 3 deletions source-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ static void update_video_encoder(struct source_record_filter_context *filter, ob
const char *enc_id = get_encoder_id(settings);
filter->encoder = obs_video_encoder_create(enc_id, obs_source_get_name(filter->source), settings, NULL);
obs_encoder_set_scaled_size(filter->encoder, 0, 0);
obs_encoder_set_video(filter->encoder, filter->video_output);
}
obs_encoder_set_video(filter->encoder, filter->video_output);
}
if (filter->fileOutput && obs_output_get_video_encoder(filter->fileOutput) != filter->encoder)
obs_output_set_video_encoder(filter->fileOutput, filter->encoder);
Expand Down Expand Up @@ -674,11 +674,11 @@ static void source_record_filter_update(void *data, obs_data_t *settings)
}

if (!replay_buffer && !record && !stream) {
if (filter->encoder) {
if (filter->encoder && !obs_encoder_active(filter->encoder)) {
obs_encoder_release(filter->encoder);
filter->encoder = NULL;
}
if (filter->aacTrack) {
if (filter->aacTrack && !obs_encoder_active(filter->aacTrack)) {
obs_encoder_release(filter->aacTrack);
filter->aacTrack = NULL;
}
Expand Down

0 comments on commit 3c42da3

Please sign in to comment.