[vlc-commits] [Git][videolan/vlc][master] access: libdvdread 6.1.2 supports UTF-8 paths in Windows.

Hugo Beauzée-Luyssen gitlab at videolan.org
Tue Jun 8 09:54:56 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
262b5460 by Petri Hintukainen at 2021-06-08T09:54:47+00:00
access: libdvdread 6.1.2 supports UTF-8 paths in Windows.

- - - - -


2 changed files:

- modules/access/dvdnav.c
- modules/access/dvdread.c


Changes:

=====================================
modules/access/dvdnav.c
=====================================
@@ -420,7 +420,14 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
         goto bailout;
 
     /* Open dvdnav */
+#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
+    /* In libdvdread prior to 6.1.2, UTF8 is not supported for windows and
+     * requires a prior conversion.
+     * For non win32/os2 platforms, this is just a no-op */
     psz_path = ToLocale( psz_file );
+#else
+    psz_path = psz_file;
+#endif
 #if DVDNAV_VERSION >= 60100
     dvdnav_logger_cb cbs = { .pf_log = DvdNavLog };
     if( dvdnav_open2( &p_dvdnav, p_demux, &cbs, psz_path  ) != DVDNAV_STATUS_OK )
@@ -438,8 +445,10 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
 
 bailout:
     free( psz_file );
+#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
     if( psz_path )
         LocaleFree( psz_path );
+#endif
     return i_ret;
 }
 


=====================================
modules/access/dvdread.c
=====================================
@@ -202,14 +202,23 @@ static int Open( vlc_object_t *p_this )
     }
 
     /* Open dvdread */
+#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
+    /* In libdvdread prior to 6.1.2, UTF8 is not supported for windows and
+     * requires a prior conversion.
+     * For non win32/os2 platforms, this is just a no-op */
     const char *psz_path = ToLocale( psz_file );
+#else
+    const char *psz_path = psz_file;
+#endif
 #if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
     dvd_logger_cb cbs = { .pf_log = DvdReadLog };
     dvd_reader_t *p_dvdread = DVDOpen2( p_demux, &cbs, psz_path );
 #else
     dvd_reader_t *p_dvdread = DVDOpen( psz_path );
 #endif
+#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
     LocaleFree( psz_path );
+#endif
     if( p_dvdread == NULL )
     {
         msg_Err( p_demux, "DVDRead cannot open source: %s", psz_file );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/262b546066c6fde1458beb467966bbc1972a24d8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/262b546066c6fde1458beb467966bbc1972a24d8
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list