mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Prevent sigsegv when no video exist in the file
This commit is contained in:
parent
20bf6851c0
commit
7f6721147a
@ -152,6 +152,7 @@ func (fs *FileStream) Destroy() {
|
||||
func (fs *FileStream) GetMaster() string {
|
||||
master := "#EXTM3U\n"
|
||||
// TODO: also check if the codec is valid in a hls before putting transmux
|
||||
if fs.Info.Video != nil {
|
||||
if fs.CanTransmux {
|
||||
master += "#EXT-X-STREAM-INF:"
|
||||
master += fmt.Sprintf("AVERAGE-BANDWIDTH=%d,", fs.Info.Video.Bitrate)
|
||||
@ -174,6 +175,7 @@ func (fs *FileStream) GetMaster() string {
|
||||
master += fmt.Sprintf("./%s/index.m3u8\n", quality)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, audio := range fs.Info.Audios {
|
||||
master += "#EXT-X-MEDIA:TYPE=AUDIO,"
|
||||
master += "GROUP-ID=\"audio\","
|
||||
|
Loading…
x
Reference in New Issue
Block a user