mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
Make setting the max # of segments in playlist optional
This commit is contained in:
parent
9b104f1d40
commit
0027957a33
3 changed files with 9 additions and 4 deletions
|
@ -36,9 +36,6 @@ videoSettings:
|
||||||
videoBitrate: 800
|
videoBitrate: 800
|
||||||
encoderPreset: superfast
|
encoderPreset: superfast
|
||||||
|
|
||||||
files:
|
|
||||||
maxNumberInPlaylist: 30
|
|
||||||
|
|
||||||
ipfs:
|
ipfs:
|
||||||
enabled: false
|
enabled: false
|
||||||
gateway: https://ipfs.io
|
gateway: https://ipfs.io
|
||||||
|
|
|
@ -189,6 +189,14 @@ func (c *config) GetPublicWebServerPort() int {
|
||||||
return 8080
|
return 8080
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) GetMaxNumberOfReferencedSegmentsInPlaylist() int {
|
||||||
|
if c.Files.MaxNumberInPlaylist > 0 {
|
||||||
|
return c.Files.MaxNumberInPlaylist
|
||||||
|
}
|
||||||
|
|
||||||
|
return 20
|
||||||
|
}
|
||||||
|
|
||||||
//Load tries to load the configuration file
|
//Load tries to load the configuration file
|
||||||
func Load(filePath string, versionInfo string) error {
|
func Load(filePath string, versionInfo string) error {
|
||||||
Config = new(config)
|
Config = new(config)
|
||||||
|
|
|
@ -112,7 +112,7 @@ func (t *Transcoder) getString() string {
|
||||||
// HLS Output
|
// HLS Output
|
||||||
"-f", "hls",
|
"-f", "hls",
|
||||||
"-hls_time", strconv.Itoa(t.segmentLengthSeconds), // Length of each segment
|
"-hls_time", strconv.Itoa(t.segmentLengthSeconds), // Length of each segment
|
||||||
"-hls_list_size", strconv.Itoa(config.Config.Files.MaxNumberInPlaylist), // Max # in variant playlist
|
"-hls_list_size", strconv.Itoa(config.Config.GetMaxNumberOfReferencedSegmentsInPlaylist()), // Max # in variant playlist
|
||||||
"-hls_delete_threshold", "10", // Start deleting files after hls_list_size + 10
|
"-hls_delete_threshold", "10", // Start deleting files after hls_list_size + 10
|
||||||
"-hls_flags", strings.Join(hlsOptionFlags, "+"), // Specific options in HLS generation
|
"-hls_flags", strings.Join(hlsOptionFlags, "+"), // Specific options in HLS generation
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue