[vlc-commits] access: dvdread: use DVDOpen2

Francois Cartegnie git at videolan.org
Fri Mar 27 11:20:34 CET 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb 21 10:57:35 2020 +0100| [9952567eb26ccb226cddfc9908d2e6d8cd4c1e45] | committer: Francois Cartegnie

access: dvdread: use DVDOpen2

(cherry picked from commit 5121360f25308504034cf36afaecd67f88bc7372)

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

 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 66238728d1..442b3a0e49 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -157,6 +157,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:
  *****************************************************************************/
@@ -193,8 +200,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