summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormasato <masato.hirahata@gmail.com>2020-11-25 20:24:58 +0900
committerVille Skyttä <ville.skytta@iki.fi>2020-12-30 23:47:21 +0200
commit98f737bfdc149f268d710612e3c3e254dbfe7cbe (patch)
tree8fdd6af69ed8c3039438317fbf0686d9519ec1c1
parentcfb3fab580b1bd522f308025e70ea95f0a52ed13 (diff)
downloadshared-mime-info-98f737bfdc149f268d710612e3c3e254dbfe7cbe.tar.gz
audio/mpeg: add layer 2, 2.5, and 1 protected magics
Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/46
-rw-r--r--data/freedesktop.org.xml.in5
-rw-r--r--tests/mime-detection/list15
-rw-r--r--tests/mime-detection/test-id3.mp3bin0 -> 9275 bytes
-rw-r--r--tests/mime-detection/test-noid3-v1-protected.mp3bin0 -> 9194 bytes
-rw-r--r--tests/mime-detection/test-noid3-v1.mp3 (renamed from tests/mime-detection/test-noid3.mp3)bin9194 -> 9194 bytes
-rw-r--r--tests/mime-detection/test-noid3-v2-protected.mp3bin0 -> 4608 bytes
-rw-r--r--tests/mime-detection/test-noid3-v2.mp3bin0 -> 4608 bytes
-rw-r--r--tests/mime-detection/test-noid3-v2_5-protected.mp3bin0 -> 2688 bytes
-rw-r--r--tests/mime-detection/test-noid3-v2_5.mp3bin0 -> 2688 bytes
9 files changed, 19 insertions, 1 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in
index 7b4a8139..18ee9399 100644
--- a/data/freedesktop.org.xml.in
+++ b/data/freedesktop.org.xml.in
@@ -4426,7 +4426,12 @@ command to generate the output files.
<alias type="audio/x-mpeg"/>
<alias type="audio/mp3"/>
<magic priority="50">
+ <match type="big16" value="0xfffa" offset="0"/>
<match type="big16" value="0xfffb" offset="0"/>
+ <match type="big16" value="0xfff3" offset="0"/>
+ <match type="big16" value="0xfff2" offset="0"/>
+ <match type="big16" value="0xffe3" offset="0"/>
+ <match type="big16" value="0xffe2" offset="0"/>
<match type="string" value="ID3" offset="0"/>
</magic>
<glob pattern="*.mp3"/>
diff --git a/tests/mime-detection/list b/tests/mime-detection/list
index 16e62d96..2f5f7290 100644
--- a/tests/mime-detection/list
+++ b/tests/mime-detection/list
@@ -517,7 +517,20 @@ test.ts video/mp2t x
bbc.ram application/ram oxo
bbc.ram application/vnd.rn-realmedia xox
# Converted from test.wav
-test-noid3.mp3 audio/mpeg
+# http://www.datavoyage.com/mpgscript/mpeghdr.htm
+# lame --add-id3v2 test.wav test-id3.mp3
+test-id3.mp3 audio/mpeg
+test-noid3-v1.mp3 audio/mpeg
+# lame -p --resample 44.1 test.wav test-noid3-v1-protected.mp3
+test-noid3-v1-protected.mp3 audio/mpeg
+# lame --resample 24 test.wav test-noid3-v2.mp3
+test-noid3-v2.mp3 audio/mpeg
+# lame -p --resample 24 test.wav test-noid3-v2-protected.mp3
+test-noid3-v2-protected.mp3 audio/mpeg
+# lame --resample 12 test.wav test-noid3-v2_5.mp3
+test-noid3-v2_5.mp3 audio/mpeg
+# lame -p --resample 12 test.wav test-noid3-v2_5-protected.mp3
+test-noid3-v2_5-protected.mp3 audio/mpeg
# "Back to the 80s" by Aqua, as purchased on Amazon US
xml-in-mp3.mp3 audio/mpeg
# http://samples.mplayerhq.hu/A-codecs/AAC/ct_faac-adts.aac
diff --git a/tests/mime-detection/test-id3.mp3 b/tests/mime-detection/test-id3.mp3
new file mode 100644
index 00000000..325957a7
--- /dev/null
+++ b/tests/mime-detection/test-id3.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3-v1-protected.mp3 b/tests/mime-detection/test-noid3-v1-protected.mp3
new file mode 100644
index 00000000..308450ce
--- /dev/null
+++ b/tests/mime-detection/test-noid3-v1-protected.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3.mp3 b/tests/mime-detection/test-noid3-v1.mp3
index 18bc576c..18bc576c 100644
--- a/tests/mime-detection/test-noid3.mp3
+++ b/tests/mime-detection/test-noid3-v1.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3-v2-protected.mp3 b/tests/mime-detection/test-noid3-v2-protected.mp3
new file mode 100644
index 00000000..439fcf59
--- /dev/null
+++ b/tests/mime-detection/test-noid3-v2-protected.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3-v2.mp3 b/tests/mime-detection/test-noid3-v2.mp3
new file mode 100644
index 00000000..081b6563
--- /dev/null
+++ b/tests/mime-detection/test-noid3-v2.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3-v2_5-protected.mp3 b/tests/mime-detection/test-noid3-v2_5-protected.mp3
new file mode 100644
index 00000000..2559fb92
--- /dev/null
+++ b/tests/mime-detection/test-noid3-v2_5-protected.mp3
Binary files differ
diff --git a/tests/mime-detection/test-noid3-v2_5.mp3 b/tests/mime-detection/test-noid3-v2_5.mp3
new file mode 100644
index 00000000..72476bc2
--- /dev/null
+++ b/tests/mime-detection/test-noid3-v2_5.mp3
Binary files differ