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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user