From fdd916a9e0d94bbf49f74c3b796e1bab88964d4c Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Tue, 28 Jan 2020 03:01:26 +0000
Subject: CTAN sync 202001280301

---
 macros/latex/contrib/media9/media9.sty | 64 ++++++++++++----------------------
 1 file changed, 22 insertions(+), 42 deletions(-)

(limited to 'macros/latex/contrib/media9/media9.sty')

diff --git a/macros/latex/contrib/media9/media9.sty b/macros/latex/contrib/media9/media9.sty
index 7d34986484..14ba62ef41 100644
--- a/macros/latex/contrib/media9/media9.sty
+++ b/macros/latex/contrib/media9/media9.sty
@@ -37,8 +37,8 @@
 \RequirePackage{xparse}
 \RequirePackage{atbegshi}
 
-\def\g@mix@date@tl{2019/11/04}
-\def\g@mix@version@tl{1.04}
+\def\g@mix@date@tl{2020/01/27}
+\def\g@mix@version@tl{1.05}
 
 \ProvidesExplPackage{media9}{\g@mix@date@tl}{\g@mix@version@tl}
 {acrobat-9/X compatible media}
@@ -339,25 +339,6 @@
   Line~\msg_line_number: :~
   File~`#1'~not~found.}{Make~sure~file~`#1'~exists~and~is~readable!}
 
-\sys_if_engine_pdftex:TF{
-  %\pdfmdfivesum is used for hashing object references of embedded files
-  \cs_new:Nn\mix_filemdfivesum:n{\pdfmdfivesum~file~{#1}}
-  \cs_new:Nn\mix_unescapehex:n{(\pdfunescapehex{#1})}
-}{
-  \sys_if_engine_luatex:TF{
-    \RequirePackage{pdftexcmds}
-    \cs_new_nopar:Nn\mix_filemdfivesum:n{\pdf@filemdfivesum{#1}}
-    %\cs_new:Nn\mix_unescapehex:n{<#1>}
-    \cs_new_nopar:Nn\mix_unescapehex:n{(\pdf@unescapehex{#1})}
-  }{
-    \cs_if_exist:NTF\mdfivesum{
-      \cs_new_nopar:Nn\mix_filemdfivesum:n{\mdfivesum file {#1}}
-    }{
-      \cs_new_nopar:Nn\mix_filemdfivesum:n{#1}
-    }
-  }
-}
-
 %creating global definitions
 \cs_new:Npn\mix@newkey#1#2{\tl_gset:cx{#1}{#2}}
 \AtBeginDocument{
@@ -503,23 +484,22 @@
   \tl_gset:Nx\g_mix_btnocg_tl{\ocgbase_last_ocg:}
 }
 
-%output mode dependent command definitions
-\sys_if_output_pdf:TF{
-  \cs_new:Nn\mix_ndname:n{%#1:HEX encoded string
-    %converted to binary UTF16BE using \pdfunescapehex (pdfTeX only)
-    \tl_set:Nn\l_mix_ndname_tl{\mix_unescapehex:n{#1}}
-  }
-}{
-  \bool_if:NTF\g_mix_dvipdfmx_bool{ %dvipdfmx/XeTeX
-    \cs_new:Nn\mix_ndname:n{%#1:HEX encoded UTF16BE string
-      \tl_set:Nn\l_mix_ndname_tl{<#1>}
+%output mode/engine dependent command definitions
+\cs_new:Nn\mix_ndname:n{%#1:HEX encoded UTF16BE string
+  \sys_if_output_pdf:TF{
+    \sys_if_engine_pdftex:TF{ %convert to binary UTF16BE as by \pdfunescapehex
+      \str_set_convert:Nnnn\l_mix_ndname_tl{feff#1}{utf16/hex}{utf16}
+      \tl_set:Nx\l_mix_ndname_tl{(\l_mix_ndname_tl)}
+    }{ %luatex
+      \tl_set:Nn\l_mix_ndname_tl{<feff#1>}
     }
   }{
-    %3DNode name
-    \cs_new:Nn\mix_ndname:n{%#1:HEX encoded unicode string
+    \bool_if:NTF\g_mix_dvipdfmx_bool{ %dvipdfmx/XeTeX
+      \tl_set:Nn\l_mix_ndname_tl{<feff#1>}
+    }{ %dvips
       \special{ps:~
         /mix@unicode~65535~string~def~
-        (#1)~/ASCIIHexDecode~filter~mix@unicode~readstring~pop~
+        (feff#1)~/ASCIIHexDecode~filter~mix@unicode~readstring~pop~
         /mix@unicode~exch~def~
       }
       %converted to binary UTF16BE by ps2pdf
@@ -536,7 +516,7 @@
   }
   \filename@parse{#1}
   \tl_set:Nx\l_mix_base_tl{\filename@base}
-  \tl_set:Nx\l_mix_ext_tl{\tl_lower_case:n{\filename@ext}}
+  \tl_set:Nx\l_mix_ext_tl{\text_lowercase:n{\filename@ext}}
   \bool_if:NTF\l_mix_url_bool{
     \cs_if_exist:cF{url_#1}{
       \mix_pdfobj:nnn{}{dict}{/FS/URL/F(#1)}
@@ -568,16 +548,16 @@
         || \str_if_eq_p:Vn\l_mix_ext_tl{pdf}
       )
     }{
-      \cs_if_exist:cF{imgXobj_\mix_filemdfivesum:n{\l_mix_file_tl}}{
+      \cs_if_exist:cF{imgXobj_\file_mdfive_hash:n{\l_mix_file_tl}}{
         \mix_pdfximage:n{\l_mix_file_tl}
-        \tl_gset:cx{imgXobj_\mix_filemdfivesum:n{\l_mix_file_tl}}{
+        \tl_gset:cx{imgXobj_\file_mdfive_hash:n{\l_mix_file_tl}}{
           \mix_pdflastximage:
         }
       }
       %create fake FileSpec for current file name if not yet existent
       \cs_if_exist:cF{ImgFileSpecFor3D_#1}{
         \tl_gset:cx{ImgFileSpecFor3D_#1}{
-          \tl_use:c{imgXobj_\mix_filemdfivesum:n{\l_mix_file_tl}}
+          \tl_use:c{imgXobj_\file_mdfive_hash:n{\l_mix_file_tl}}
         }
       }
       %add FileSpec to assets tree of current annot
@@ -589,9 +569,9 @@
     }{
       %remaining file types in 3D context and any file type in case of Flash
       %context will be embedded as ordinary fstreams;
-      \cs_if_exist:cF{fileEmb_\mix_filemdfivesum:n{\l_mix_file_tl}}{
+      \cs_if_exist:cF{fileEmb_\file_mdfive_hash:n{\l_mix_file_tl}}{
         \mix_pdfobj:nnn{}{fstream}{{}{\l_mix_file_tl}}
-        \tl_gset:cx{fileEmb_\mix_filemdfivesum:n{\l_mix_file_tl}}{
+        \tl_gset:cx{fileEmb_\file_mdfive_hash:n{\l_mix_file_tl}}{
           \mix_pdflastobj:
         }
       }
@@ -599,7 +579,7 @@
       \cs_if_exist:cF{fileSpec_#1}{
         \mix_pdfobj:nnn{}{dict}{
           /Type/Filespec/F~(#1)%/UF~(#1)
-          /EF~<</F~\tl_use:c{fileEmb_\mix_filemdfivesum:n{\l_mix_file_tl}}>>
+          /EF~<</F~\tl_use:c{fileEmb_\file_mdfive_hash:n{\l_mix_file_tl}}>>
         }
         \tl_gset:cx{fileSpec_#1}{\mix_pdflastobj:}
         \bool_if:NT\g_mix_usrattach_bool{
@@ -1913,7 +1893,7 @@
         {\g_mix_vfile_tl}{\int_use:N\l_mix_lineno_int}
     }
     \bool_set_false:N\l_mix_blankndname_bool
-    \mix_ndname:n{feff#1}
+    \mix_ndname:n{#1}
   },
   UTFNAME .default:n = {},
 
-- 
cgit v1.2.3

