Revert "libobs: Allow source to fully control source flags (for now)"

This reverts commit d85224bb9b.

Would cause other flags to stop saving.  Buffering needs to be split off
from the source flags.
This commit is contained in:
jp9000
2017-05-13 23:30:36 -07:00
parent 3d5759335c
commit d64542e10b
2 changed files with 8 additions and 2 deletions
+1 -2
View File
@@ -330,8 +330,6 @@ static obs_source_t *obs_source_create_internal(const char *id,
if (!private)
obs_source_init_audio_hotkeys(source);
source->flags = source->default_flags;
/* allow the source to be created even if creation fails so that the
* user's data doesn't become lost */
if (info)
@@ -344,6 +342,7 @@ static obs_source_t *obs_source_create_internal(const char *id,
private ? "private " : "", name, id);
obs_source_dosignal(source, "source_create", NULL);
source->flags = source->default_flags;
source->enabled = true;
return source;
+7
View File
@@ -1454,6 +1454,7 @@ static obs_source_t *obs_load_source_type(obs_data_t *source_data)
obs_data_t *hotkeys = obs_data_get_obj(source_data, "hotkeys");
double volume;
int64_t sync;
uint32_t flags;
uint32_t mixers;
int di_order;
int di_mode;
@@ -1474,6 +1475,10 @@ static obs_source_t *obs_load_source_type(obs_data_t *source_data)
mixers = (uint32_t)obs_data_get_int(source_data, "mixers");
obs_source_set_audio_mixers(source, mixers);
obs_data_set_default_int(source_data, "flags", source->default_flags);
flags = (uint32_t)obs_data_get_int(source_data, "flags");
obs_source_set_flags(source, flags);
obs_data_set_default_bool(source_data, "enabled", true);
obs_source_set_enabled(source,
obs_data_get_bool(source_data, "enabled"));
@@ -1596,6 +1601,7 @@ obs_data_t *obs_save_source(obs_source_t *source)
float volume = obs_source_get_volume(source);
uint32_t mixers = obs_source_get_audio_mixers(source);
int64_t sync = obs_source_get_sync_offset(source);
uint32_t flags = obs_source_get_flags(source);
const char *name = obs_source_get_name(source);
const char *id = obs_source_get_id(source);
bool enabled = obs_source_enabled(source);
@@ -1623,6 +1629,7 @@ obs_data_t *obs_save_source(obs_source_t *source)
obs_data_set_obj (source_data, "settings", settings);
obs_data_set_int (source_data, "mixers", mixers);
obs_data_set_int (source_data, "sync", sync);
obs_data_set_int (source_data, "flags", flags);
obs_data_set_double(source_data, "volume", volume);
obs_data_set_bool (source_data, "enabled", enabled);
obs_data_set_bool (source_data, "muted", muted);