mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 21:24:20 -04:00
Relax same codec check to not care about h264 level
This commit is contained in:
parent
5e054e12f7
commit
d3ec0cab9b
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -90,10 +91,12 @@ func (fs *FileStream) GetMaster() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aspectRatio := float32(fs.Info.Video.Width) / float32(fs.Info.Video.Height)
|
aspectRatio := float32(fs.Info.Video.Width) / float32(fs.Info.Video.Height)
|
||||||
transmux_codec := "avc1.640028"
|
// codec is the prefix + the level, the level is not part of the codec we want to compare for the same_codec check bellow
|
||||||
|
transmux_prefix := "avc1.6400"
|
||||||
|
transmux_codec := transmux_prefix + "28"
|
||||||
|
|
||||||
for _, quality := range Qualities {
|
for _, quality := range Qualities {
|
||||||
same_codec := fs.Info.Video.MimeCodec != nil && *fs.Info.Video.MimeCodec == transmux_codec
|
same_codec := fs.Info.Video.MimeCodec != nil && strings.HasPrefix(*fs.Info.Video.MimeCodec, transmux_prefix)
|
||||||
inc_lvl := quality.Height() < fs.Info.Video.Quality.Height() ||
|
inc_lvl := quality.Height() < fs.Info.Video.Quality.Height() ||
|
||||||
(quality.Height() == fs.Info.Video.Quality.Height() && !same_codec)
|
(quality.Height() == fs.Info.Video.Quality.Height() && !same_codec)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user