[vlc-commits] access: dvdread: use DVDOpen2

Francois Cartegnie git at videolan.org
Mon Mar 9 15:39:44 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb 21 10:57:35 2020 +0100| [5121360f25308504034cf36afaecd67f88bc7372] | committer: Francois Cartegnie

access: dvdread: use DVDOpen2

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

 modules/access/dvdread.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 65d087c330..657cdcacb2 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -156,6 +156,13 @@ static int  DvdReadSeek     ( demux_t *, int );
 static void DvdReadHandleDSI( demux_t *, uint8_t * );
 static void DvdReadFindCell ( demux_t * );
 
+#if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
+static void DvdReadLog( void *foo, dvd_logger_level_t i, const char *p, va_list z )
+{
+    demux_t *p_demux = (demux_t*)foo;
+    msg_GenericVa( p_demux, i, p, z );
+}
+#endif
 /*****************************************************************************
  * Open:
  *****************************************************************************/
@@ -189,8 +196,13 @@ static int Open( vlc_object_t *p_this )
 
     /* Open dvdread */
     const char *psz_path = ToLocale( psz_file );
+#if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
+    dvd_logger_cb cbs;
+    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
     LocaleFree( psz_path );
     if( p_dvdread == NULL )
     {



More information about the vlc-commits mailing list