mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 13:55:07 +00:00
source-mirror: Correctly check for Audio and Video source
Previously this would not do anything correctly, as the call to obs_source_get_flags does not return anything for most sources. Instead obs_source_get_output_flags should be used to verify that we actually have a video or audio capable source to work with.
This commit is contained in:
parent
4d66938832
commit
381aa3ecd4
1 changed files with 2 additions and 2 deletions
|
@ -350,7 +350,7 @@ void source::mirror::mirror_instance::acquire_input(std::string source_name)
|
|||
this->m_source = std::move(new_source);
|
||||
this->m_source->events.rename += std::bind(&source::mirror::mirror_instance::on_source_rename, this,
|
||||
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
||||
if (m_audio_enabled) {
|
||||
if ((obs_source_get_output_flags(this->m_source->get()) & OBS_SOURCE_AUDIO) != 0) {
|
||||
this->m_source->events.audio_data +=
|
||||
std::bind(&source::mirror::mirror_instance::on_audio_data, this, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
|
@ -540,7 +540,7 @@ void source::mirror::mirror_instance::video_render(gs_effect_t* effect)
|
|||
}
|
||||
|
||||
// Don't bother rendering sources that aren't video.
|
||||
if (obs_source_get_flags(this->m_source->get()) & OBS_SOURCE_VIDEO) {
|
||||
if ((obs_source_get_output_flags(this->m_source->get()) & OBS_SOURCE_VIDEO) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue