[vlc-commits] dvdread: Implement analog access check as in dvdnav
David Fuhrmann
git at videolan.org
Wed May 13 19:30:32 CEST 2020
vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Mon May 4 20:07:41 2020 +0200| [efec119e80394421537c445a1459909ebe837157] | committer: David Fuhrmann
dvdread: Implement analog access check as in dvdnav
(cherry picked from commit 7555e75a779907791238a1f50e1fdaf25b7d23e5)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=efec119e80394421537c445a1459909ebe837157
---
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 7c9f10b055..21d88af5db 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -235,7 +235,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 6fab0d25e7..e75bef5986 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -68,6 +68,8 @@
#include <assert.h>
#include <limits.h>
+#include "disc_helper.h"
+
/*****************************************************************************
* Module descriptor
*****************************************************************************/
@@ -203,6 +205,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)
@@ -216,15 +224,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