diff options
author | jbrjake <[email protected]> | 2008-03-22 00:16:22 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2008-03-22 00:16:22 +0000 |
commit | ecc54675dddb56825215ce0c11358f81fc72f660 (patch) | |
tree | 22d60adb6b98b2a388445d1a2436bcea431009d4 /macosx | |
parent | 9880cbfd5b0db35bff71efa524e11c6c4dcfbe68 (diff) |
"If one would give me six lines written by the hand of the most honest man, I would find something in them to have him hanged."
- Banishes libdvdcss, removing DVD decryption from HandBrake's binaries.
- For decrypttion, the MacGui and Mac CLI now will load at runtime VLC's dynamic library of dvdcss if the media player's available on the user's system.
- Linux users can build with a statically linked lib of dvdcss by using ./configure --libdvdcss, which will download it from a remote third party (videolan.org).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1354 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 75 | ||||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 9 |
2 files changed, 65 insertions, 19 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 207f1f1bc..2534994d5 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1229,6 +1229,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* Here we actually tell hb_scan to perform the source scan, using the path to source and title number*/ - (void) performScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum { + /* use a bool to determine whether or not we can decrypt using vlc */ + BOOL cancelScanDecrypt = 0; NSString *path = scanPath; HBDVDDetector *detector = [HBDVDDetector detectorForPath:path]; if( [detector isVideoDVD] ) @@ -1237,21 +1239,74 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It // device path instead. path = [detector devicePath]; [self writeToActivityLog: "trying to open a physical dvd at: %s", [scanPath UTF8String]]; + + /* lets check for vlc here to make sure we have a dylib available to use for decrypting */ + NSString *vlcPath = @"/Applications/VLC.app"; + NSFileManager * fileManager = [NSFileManager defaultManager]; + if ([fileManager fileExistsAtPath:vlcPath] == 0) + { + /*vlc not found in /Applications so we set the bool to cancel scanning to 1 */ + cancelScanDecrypt = 1; + [self writeToActivityLog: "VLC app not found for decrypting physical dvd"]; + int status; + status = NSRunAlertPanel(@"HandBrake could not find VLC.",@"Please download and install VLC media player in your /Applications folder if you wish to read encrypted DVDs.", @"Get VLC", @"Cancel Scan", @"Attempt Scan Anyway"); + [NSApp requestUserAttention:NSCriticalRequest]; + + if (status == NSAlertDefaultReturn) + { + /* User chose to go download vlc (as they rightfully should) so we send them to the vlc site */ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.videolan.org/"]]; + } + else if (status == NSAlertAlternateReturn) + { + /* User chose to cancel the scan */ + [self writeToActivityLog: "cannot open physical dvd , scan cancelled"]; + } + else + { + /* User chose to override our warning and scan the physical dvd anyway, at their own peril. on an encrypted dvd this produces massive log files and fails */ + cancelScanDecrypt = 0; + [self writeToActivityLog: "user overrode vlc warning -trying to open physical dvd without decryption"]; + } + + } + else + { + /* VLC was found in /Applications so all is well, we can carry on using vlc's libdvdcss.dylib for decrypting if needed */ + [self writeToActivityLog: "VLC app found for decrypting physical dvd"]; + } + } - /* If there is no title number passed to scan, we use "0" - * which causes the default behavior of a full source scan - */ - if (!scanTitleNum) + + + + if (cancelScanDecrypt == 0) { - scanTitleNum = 0; + + /* we actually pass the scan off to libhb here */ + /* If there is no title number passed to scan, we use "0" + * which causes the default behavior of a full source scan + */ + if (!scanTitleNum) + { + scanTitleNum = 0; + } + if (scanTitleNum > 0) + { + [self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum]; + } + hb_scan( fHandle, [path UTF8String], scanTitleNum ); + [fSrcDVD2Field setStringValue: [NSString stringWithFormat: @"Scanning new source ..."]]; } - if (scanTitleNum > 0) + else { - [self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum]; + /* if we have a title loaded up */ + if ([[fSrcDVD2Field stringValue] length] > 0) + { + [self enableUI: YES]; + } } - [fSrcDVD2Field setStringValue: [NSString stringWithFormat: @"Scanning new source ..."]]; - /* we actually pass the scan off to libhb here */ - hb_scan( fHandle, [path UTF8String], scanTitleNum ); + } diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 7cc5b5265..d8973ae13 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -976,7 +976,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1037,7 +1036,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1096,7 +1094,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1182,7 +1179,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1228,7 +1224,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1349,7 +1344,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1393,7 +1387,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1450,7 +1443,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, @@ -1510,7 +1502,6 @@ ../contrib/lib/libavcodec.a, ../contrib/lib/libavutil.a, ../contrib/lib/libdvdread.a, - ../contrib/lib/libdvdcss.a, ../contrib/lib/libfaac.a, ../contrib/lib/libmp3lame.a, ../contrib/lib/libmpeg2.a, |