mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
UI: Add "enforce streaming service settings"
Add a checkbox named "Enforce streaming service encoder settings" checkbox to advanced output. Disabling this checkbox allows the user to optionally disable the enforcement of streaming service encoder settings. I had a user complain that they didn't want to always have the service's preferred encoder settings forced on them.
This commit is contained in:
@@ -401,6 +401,8 @@ inline void AdvancedOutput::SetupStreaming()
|
||||
"TrackIndex");
|
||||
int trackCount = config_get_int(main->Config(), "AdvOut",
|
||||
"TrackCount");
|
||||
bool applyServiceSettings = config_get_bool(main->Config(), "AdvOut",
|
||||
"ApplyServiceSettings");
|
||||
unsigned int cx = 0;
|
||||
unsigned int cy = 0;
|
||||
|
||||
@@ -414,16 +416,33 @@ inline void AdvancedOutput::SetupStreaming()
|
||||
|
||||
obs_output_set_video_encoder(streamOutput, h264Streaming);
|
||||
|
||||
if (applyServiceSettings) {
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
h264Streaming, nullptr);
|
||||
}
|
||||
|
||||
if (multitrack) {
|
||||
int i = 0;
|
||||
for (; i < trackCount; i++)
|
||||
for (; i < trackCount; i++) {
|
||||
obs_output_set_audio_encoder(streamOutput, aacTrack[i],
|
||||
i);
|
||||
|
||||
if (applyServiceSettings)
|
||||
obs_service_apply_encoder_settings(
|
||||
main->GetService(), nullptr,
|
||||
aacTrack[i]);
|
||||
}
|
||||
|
||||
for (; i < 4; i++)
|
||||
obs_output_set_audio_encoder(streamOutput, nullptr, i);
|
||||
|
||||
} else {
|
||||
obs_output_set_audio_encoder(streamOutput,
|
||||
aacTrack[trackIndex - 1], 0);
|
||||
|
||||
if (applyServiceSettings)
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
nullptr, aacTrack[trackIndex - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user