Make things not break if video passthrough is enabled + update admin to display video settings a bit clearer. A start to #306

This commit is contained in:
Gabe Kangas
2020-11-19 22:07:28 -08:00
parent e860f9ab2f
commit 92dc98a0ea
5 changed files with 36 additions and 12 deletions

View File

@@ -232,6 +232,10 @@ func (c *config) GetVideoStreamQualities() []StreamQuality {
// GetFramerate returns the framerate or default.
func (q *StreamQuality) GetFramerate() int {
if q.IsVideoPassthrough {
return 0
}
if q.Framerate > 0 {
return q.Framerate
}
@@ -241,6 +245,10 @@ func (q *StreamQuality) GetFramerate() int {
// GetEncoderPreset returns the preset or default.
func (q *StreamQuality) GetEncoderPreset() string {
if q.IsVideoPassthrough {
return ""
}
if q.EncoderPreset != "" {
return q.EncoderPreset
}
@@ -248,6 +256,18 @@ func (q *StreamQuality) GetEncoderPreset() string {
return _default.VideoSettings.StreamQualities[0].EncoderPreset
}
func (q *StreamQuality) GetIsAudioPassthrough() bool {
if q.IsAudioPassthrough {
return true
}
if q.AudioBitrate == 0 {
return true
}
return false
}
// Load tries to load the configuration file.
func Load(filePath string, versionInfo string, versionNumber string) error {
Config = new(config)