Skip to content

Commit

Permalink
Merge pull request #735 from leonid-shevtsov/another-m4v-signature
Browse files Browse the repository at this point in the history
Add another file type signature for .m4v files
  • Loading branch information
kean authored Nov 14, 2023
2 parents 81b8b52 + 6e8eeab commit 7f81f9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Nuke/Decoding/AssetType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ extension AssetType {
// https://en.wikipedia.org/wiki/List_of_file_signatures
if _match([0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D], offset: 4) { return .mp4 }

// https://www.garykessler.net/library/file_sigs.html
if _match([0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32], offset: 4) { return .m4v }

if _match([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x56, 0x20], offset: 4) { return .m4v }

// MOV magic numbers https://www.garykessler.net/library/file_sigs.html
if _match([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], offset: 4) { return .mov }
Expand Down

0 comments on commit 7f81f9b

Please sign in to comment.