coreaudio-encoder: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the properties of a source, but also of a source type. The latter would pass a NULL pointer for a given source. This adds the necessary change to avoid crashing OBS by passing such a null pointer.
This commit is contained in:
parent
5eaf95a2b9
commit
2a721d92b3
1 changed files with 12 additions and 8 deletions
|
|
@ -1361,24 +1361,28 @@ static bool samplerate_updated(obs_properties_t *props, obs_property_t *prop,
|
|||
|
||||
static obs_properties_t *aac_properties(void *data)
|
||||
{
|
||||
ca_encoder *ca = static_cast<ca_encoder *>(data);
|
||||
|
||||
obs_properties_t *props = obs_properties_create();
|
||||
|
||||
obs_property_t *p = obs_properties_add_list(
|
||||
obs_property_t *sample_rates = obs_properties_add_list(
|
||||
props, "samplerate", obs_module_text("OutputSamplerate"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
add_samplerates(p, ca);
|
||||
obs_property_set_modified_callback(p, samplerate_updated);
|
||||
|
||||
p = obs_properties_add_list(props, "bitrate",
|
||||
obs_module_text("Bitrate"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
add_bitrates(p, ca);
|
||||
obs_property_set_modified_callback(sample_rates, samplerate_updated);
|
||||
|
||||
obs_property_t *bit_rates = obs_properties_add_list(
|
||||
props, "bitrate", obs_module_text("Bitrate"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_properties_add_bool(props, "allow he-aac",
|
||||
obs_module_text("AllowHEAAC"));
|
||||
|
||||
if (data) {
|
||||
ca_encoder *ca = static_cast<ca_encoder *>(data);
|
||||
add_samplerates(sample_rates, ca);
|
||||
add_bitrates(bit_rates, ca);
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue