[vlc-commits] dvdread: Implement analog access check as in dvdnav
David Fuhrmann
git at videolan.org
Thu May 7 18:38:28 CEST 2020
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Mon May 4 20:07:41 2020 +0200| [7555e75a779907791238a1f50e1fdaf25b7d23e5] | committer: David Fuhrmann
dvdread: Implement analog access check as in dvdnav
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7555e75a779907791238a1f50e1fdaf25b7d23e5
---
modules/access/Makefile.am | 2 +-
modules/access/dvdread.c | 15 ++++++++-------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index b6b3af2266..5fb23de555 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -252,7 +252,7 @@ endif
access_LTLIBRARIES += $(LTLIBdvdnav)
EXTRA_LTLIBRARIES += libdvdnav_plugin.la
-libdvdread_plugin_la_SOURCES = access/dvdread.c demux/mpeg/ps.h demux/mpeg/pes.h \
+libdvdread_plugin_la_SOURCES = access/disc_helper.h access/dvdread.c demux/mpeg/ps.h demux/mpeg/pes.h \
demux/moving_avg.h demux/timestamps_filter.h
libdvdread_plugin_la_CFLAGS = $(AM_CFLAGS) $(DVDREAD_CFLAGS)
libdvdread_plugin_la_LIBADD = $(DVDREAD_LIBS)
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 657cdcacb2..ae0ed798cd 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -62,6 +62,8 @@
#include <assert.h>
#include <limits.h>
+#include "disc_helper.h"
+
/*****************************************************************************
* Module descriptor
*****************************************************************************/
@@ -194,6 +196,12 @@ static int Open( vlc_object_t *p_this )
if( unlikely(psz_file == NULL) )
return VLC_EGENERIC;
+ if( DiscProbeMacOSPermission( p_this, psz_file ) != VLC_SUCCESS )
+ {
+ free( psz_file );
+ return VLC_EGENERIC;
+ }
+
/* Open dvdread */
const char *psz_path = ToLocale( psz_file );
#if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
@@ -207,15 +215,8 @@ static int Open( vlc_object_t *p_this )
if( p_dvdread == NULL )
{
msg_Err( p_demux, "DVDRead cannot open source: %s", psz_file );
-#ifdef __APPLE__
- vlc_dialog_display_error( p_demux, _("Problem accessing a system resource"),
- _("Potentially, macOS blocks access to your disc. "
- "Please open \"System Preferences\" -> \"Security & Privacy\" "
- "and allow VLC to access your external media in \"Files and Folders\" section."));
-#else
vlc_dialog_display_error( p_demux, _("Playback failure"),
_("DVDRead could not open the disc \"%s\"."), psz_file );
-#endif
free( psz_file );
return VLC_EGENERIC;
More information about the vlc-commits
mailing list