Merge pull request #853 from oddstr13/fix-849-1

Gracefully handle missing VideoRangeType in stream tracks
This commit is contained in:
mcarlton00 2024-04-09 08:36:57 -04:00 committed by GitHub
commit b585377476
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,15 +75,10 @@ class API(object):
if "DvProfile" in track: if "DvProfile" in track:
track['hdrtype'] = "dolbyvision" track['hdrtype'] = "dolbyvision"
elif track.get('VideoRangeType', '') in ["HDR10", "HDR10Plus"]:
elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]:
track['hdrtype'] = "hdr10" track['hdrtype'] = "hdr10"
elif "HLG" in track.get('VideoRangeType', ''):
elif "HLG" in track['VideoRangeType']:
track['hdrtype'] = "hlg" track['hdrtype'] = "hlg"
elif track['VideoRangeType'] in ["SDR", "Unknown"]:
track['hdrtype'] = ""
track.update({ track.update({
'hdrtype': track.get('hdrtype', "").lower(), 'hdrtype': track.get('hdrtype', "").lower(),