Skip to content

Commit

Permalink
FIX: using reversed order of codecs in ENCODING? function, so user de…
Browse files Browse the repository at this point in the history
…fined codecs has higher chance to be recognized
  • Loading branch information
Oldes committed Oct 11, 2018
1 parent 850d697 commit 4707611
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mezz/sys-codec.r
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ encoding?: function [
"Returns the media codec name for given binary data. (identify)"
data [binary!]
][
foreach [name codec] system/codecs [
either handle? try [cod/entry] [

foreach name reverse words-of system/codecs [
codec: system/codecs/:name
either handle? try [codec/entry] [
if do-codec codec/entry 'identify data [
return name
]
][
if all [
function? try [:cod/identify]
cod/identify data
function? try [:codec/identify]
codec/identify data
][
return name
]
Expand Down

0 comments on commit 4707611

Please sign in to comment.