Skip to content

Commit 4707611

Browse files
committed
FIX: using reversed order of codecs in ENCODING? function, so user defined codecs has higher chance to be recognized
1 parent 850d697 commit 4707611

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/mezz/sys-codec.r

+6-4
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ encoding?: function [
8686
"Returns the media codec name for given binary data. (identify)"
8787
data [binary!]
8888
][
89-
foreach [name codec] system/codecs [
90-
either handle? try [cod/entry] [
89+
90+
foreach name reverse words-of system/codecs [
91+
codec: system/codecs/:name
92+
either handle? try [codec/entry] [
9193
if do-codec codec/entry 'identify data [
9294
return name
9395
]
9496
][
9597
if all [
96-
function? try [:cod/identify]
97-
cod/identify data
98+
function? try [:codec/identify]
99+
codec/identify data
98100
][
99101
return name
100102
]

0 commit comments

Comments
 (0)