Skip to content

Commit

Permalink
refactor(Video): Return None if no m3u RANGE, not SDR
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Apr 14, 2024
1 parent 15d73be commit 23485bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions devine/core/tracks/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ class Matrix(Enum):
return Video.Range.SDR

@staticmethod
def from_m3u_range_tag(tag: str) -> Video.Range:
def from_m3u_range_tag(tag: str) -> Optional[Video.Range]:
tag = (tag or "").upper().replace('"', '').strip()
if not tag or tag == "SDR":
if not tag:
return None
if tag == "SDR":
return Video.Range.SDR
elif tag == "PQ":
return Video.Range.HDR10 # technically could be any PQ-transfer range
Expand Down

0 comments on commit 23485bc

Please sign in to comment.