[vlc-commits] dmo: fix logging of WCHAR as a char

Steve Lhomme git at videolan.org
Wed Apr 3 10:45:16 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr  3 09:42:07 2019 +0200| [fde9fc6851a63a89dfa54fa1dfc9f50cb9331d13] | committer: Steve Lhomme

dmo: fix logging of WCHAR as a char

We read the value as a WCHAR (UNICODE is set) so we can't use the string for
logging directly.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fde9fc6851a63a89dfa54fa1dfc9f50cb9331d13
---

 modules/codec/dmo/dmo.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c
index 65f7dae01f..38fb03ce9c 100644
--- a/modules/codec/dmo/dmo.c
+++ b/modules/codec/dmo/dmo.c
@@ -37,7 +37,6 @@
 
 #ifdef _WIN32
 #   include <objbase.h>
-#   include <vlc_charset.h>
 #endif
 
 #include <vlc_codecs.h>
@@ -48,12 +47,6 @@
 # define DMO_DEBUG 1
 #endif
 
-#ifdef UNICODE
-# define PRIs "%ls"
-#else
-# define PRIs "%s"
-#endif
-
 typedef long (STDCALL *GETCLASS) ( const GUID*, const GUID*, void** );
 
 /*****************************************************************************
@@ -157,7 +150,7 @@ static const GUID guid_wmv9_enc = { 0xd23b90d0, 0x144f, 0x46bd,{ 0x84, 0x1d, 0x5
 typedef struct
 {
     vlc_fourcc_t i_fourcc;
-    const TCHAR  *psz_dll;
+    const WCHAR  *psz_dll;
     const GUID   *p_guid;
 
 } codec_dll;
@@ -244,9 +237,8 @@ static int DecoderOpen( vlc_object_t *p_this )
     {
         if( decoders_table[i].i_fourcc == p_dec->fmt_in.i_codec )
         {
-            msg_Dbg( p_dec, "DMO codec for %4.4s may work with dll="PRIs,
-                     (char*)&p_dec->fmt_in.i_codec,
-                     decoders_table[i].psz_dll );
+            msg_Dbg( p_dec, "DMO codec for %4.4s may work with dll=%ls",
+                     (char*)&p_dec->fmt_in.i_codec, decoders_table[i].psz_dll);
             goto found;
         }
     }
@@ -748,8 +740,7 @@ loader:
     *p_hmsdmo_dll = LoadLibrary( codecs_table[i_codec].psz_dll );
     if( *p_hmsdmo_dll == NULL )
     {
-        msg_Dbg( p_this, "failed loading '"PRIs"'",
-                 codecs_table[i_codec].psz_dll );
+        msg_Dbg( p_this, "failed loading '%ls'", codecs_table[i_codec].psz_dll );
         return VLC_EGENERIC;
     }
 



More information about the vlc-commits mailing list