Avoid fetching profile bitrate twice

This commit is contained in:
Serge Tkatchouk
2020-03-02 19:18:19 +08:00
committed by sentriz
parent 1ab96f67b5
commit c9eb142c61

View File

@@ -140,7 +140,7 @@ func CacheKey(sourcePath string, profile string, bitrate string) string {
// Check if client forces bitrate lower than set in profile:
func GetBitrate(clientBitrate int, profile *Profile) string {
bitrate := profile.Bitrate
if clientBitrate != 0 && clientBitrate < profile.Bitrate {
if clientBitrate != 0 && clientBitrate < bitrate {
bitrate = clientBitrate
}
return fmt.Sprintf("%dk", bitrate)