mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-18 16:17:23 -05:00
Rely on output flag to identify media sources
Using OBS_SOURCE_CONTROLLABLE_MEDIA instead of a hardcoded list of source names is much more reliable and has the upside of also supporting plugin sources
This commit is contained in:
parent
b1a3ab5493
commit
b62757b65d
|
|
@ -843,11 +843,9 @@ QStringList GetMediaSourceNames()
|
|||
auto sourceEnum = [](void *param, obs_source_t *source) -> bool /* -- */
|
||||
{
|
||||
QStringList *list = reinterpret_cast<QStringList *>(param);
|
||||
std::string sourceId = obs_source_get_id(source);
|
||||
if (sourceId.compare("ffmpeg_source") == 0 ||
|
||||
sourceId.compare("vlc_source") == 0 ||
|
||||
sourceId.compare("slideshow") == 0 ||
|
||||
sourceId.compare("media_playlist_source_codeyan") == 0) {
|
||||
uint32_t flags = obs_source_get_output_flags(source);
|
||||
|
||||
if ((flags & OBS_SOURCE_CONTROLLABLE_MEDIA) != 0) {
|
||||
*list << obs_source_get_name(source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user