Skip to content

Commit

Permalink
fix hdr playback issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yichengchen committed Jul 8, 2023
1 parent b348c95 commit a7681b8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class BilibiliVideoResourceLoaderDelegate: NSObject, AVAssetResourceLoaderDelega
supplementCodesc = codecs
videoRange = "HLG"
codecs = "hvc1.2.4.L153.b0"
} else if codecs == "dvh1.08.06" {
} else if codecs == "dvh1.08.06" || codecs == "dvh1.05.06" {
supplementCodesc = codecs
codecs = "hvc1.2.4.L150"
videoRange = "PQ"
Expand Down Expand Up @@ -239,8 +239,11 @@ class BilibiliVideoResourceLoaderDelegate: NSObject, AVAssetResourceLoaderDelega
hasSubtitle = subtitles.count > 0
var videos = info.dash.video
if Settings.preferAvc {
if videos.contains(where: { !$0.isHevc }) {
videos.removeAll(where: { $0.isHevc })
let videosMap = Dictionary(grouping: videos, by: { $0.id })
for (key, values) in videosMap {
if values.contains(where: { !$0.isHevc }) {
videos.removeAll(where: { $0.id == key && $0.isHevc })
}
}
}

Expand Down

0 comments on commit a7681b8

Please sign in to comment.