Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs-transitions: Fix stinger showing count for update during transition #11512

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugins/obs-transitions/transition-stinger.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ static void stinger_update(void *data, obs_data_t *settings)
obs_data_set_bool(media_settings, "is_stinger", true);
obs_data_set_bool(media_settings, "is_track_matte", s->track_matte_enabled);

if (s->media_source && s->transitioning)
obs_source_remove_active_child(s->source, s->media_source);
obs_source_release(s->media_source);
struct dstr name;
dstr_init_copy(&name, obs_source_get_name(s->source));
Expand All @@ -87,6 +89,8 @@ static void stinger_update(void *data, obs_data_t *settings)
dstr_free(&name);
obs_data_release(media_settings);

if (s->media_source && s->transitioning)
obs_source_add_active_child(s->source, s->media_source);
int64_t point = obs_data_get_int(settings, "transition_point");

s->transition_point_is_frame = obs_data_get_int(settings, "tp_type") == TIMING_FRAME;
Expand All @@ -107,6 +111,8 @@ static void stinger_update(void *data, obs_data_t *settings)
s->do_texrender = s->track_matte_enabled && s->matte_layout < MATTE_LAYOUT_SEPARATE_FILE;

if (s->matte_source) {
if (s->transitioning)
obs_source_remove_active_child(s->source, s->matte_source);
obs_source_release(s->matte_source);
s->matte_source = NULL;
}
Expand All @@ -120,6 +126,8 @@ static void stinger_update(void *data, obs_data_t *settings)

s->matte_source = obs_source_create_private("ffmpeg_source", NULL, tm_media_settings);
obs_data_release(tm_media_settings);
if (s->matte_source && s->transitioning)
obs_source_add_active_child(s->source, s->matte_source);

// no need to output sound from the matte video
obs_source_set_muted(s->matte_source, true);
Expand Down Expand Up @@ -476,7 +484,7 @@ static bool stinger_audio_render(void *data, uint64_t *ts_out, struct obs_source
return false;
}

if (!obs_source_audio_pending(s->media_source)) {
if (s->media_source && !obs_source_audio_pending(s->media_source)) {
ts = obs_source_get_audio_timestamp(s->media_source);
if (!ts)
return false;
Expand Down
Loading