summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgb <lgb@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-21 15:28:19 +0000
committerlgb <lgb@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-21 15:28:19 +0000
commit7897619e5759ddf63db1710fb2d5f6f821be2fc6 (patch)
treeb45cc81842ca725abd05729c6db9a7305643d4e3
parent9614ba33d6f15d162fe9eb6ec550894f2cca5bfd (diff)
downloadmpv-7897619e5759ddf63db1710fb2d5f6f821be2fc6.tar.bz2
mpv-7897619e5759ddf63db1710fb2d5f6f821be2fc6.tar.xz
Detect unencrypted DVDs and not try to auth them
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@560 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--dvdauth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dvdauth.c b/dvdauth.c
index cd3dcb94aa..6990fef643 100644
--- a/dvdauth.c
+++ b/dvdauth.c
@@ -1,5 +1,5 @@
/* (C)2001 by LGB (Gabor Lenart), based on example programs in libcss
- Some TODO: root privilegies really needed?? */
+ lgb@lgb.hu */
/* don't do anything with this source if css support was not requested */
#include "config.h"
@@ -86,17 +86,22 @@ int dvd_import_key ( unsigned char *hexkey )
}
+
int dvd_auth ( char *dev , int fd )
{
int devfd; /* FD of DVD device */
int lba;
-// printf("DVD: auth fd=%d on %s.\n",fd,dev);
if ((devfd=open(dev,O_RDONLY))<0) {
fprintf(stderr,"DVD: cannot open DVD device \"%s\".\n",dev);
return 1;
}
+
+ if (!CSSisEncrypted(devfd)) {
+ printf("DVD is unencrypted! Skipping authentication!\n(note: you should not use -dvd switch for unencrypted discs!)\n");
+ return 0;
+ } else printf("DVD is encrypted, issuing authentication ...\n");
/* reset AGIDs */
reset_agids(devfd);