Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
ec6c466b
Commit
ec6c466b
authored
Jun 10, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Movie View: add blob checker
parent
db9af945
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
AspenProject/VLCConstants.h
AspenProject/VLCConstants.h
+2
-0
AspenProject/VLCMovieViewController.m
AspenProject/VLCMovieViewController.m
+28
-2
VLC for iOS.xcodeproj/project.pbxproj
VLC for iOS.xcodeproj/project.pbxproj
+7
-0
No files found.
AspenProject/VLCConstants.h
View file @
ec6c466b
...
...
@@ -21,3 +21,5 @@
#define kSupportedFileExtensions @"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|axv|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mks|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|nsv|nuv|oga|ogg|ogm|ogv|ogx|spx|ps|qt|rar|rec|rm|rmvb|tod|ts|tts|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedSubtitleFileExtensions @"\\.(cdg|idx|srt|sub|utf|ass|ssa|aqt|jss|psb|rt|smi|txt|smil)$"
#define kBlobHash @"521923d214b9ae628da7987cf621e94c4afdd726"
AspenProject/VLCMovieViewController.m
View file @
ec6c466b
...
...
@@ -10,6 +10,7 @@
#import "VLCExternalDisplayController.h"
#import <sys/sysctl.h> // for sysctlbyname
#import <AVFoundation/AVFoundation.h>
#import <CommonCrypto/CommonDigest.h>
#define INPUT_RATE_DEFAULT 1000.
...
...
@@ -144,6 +145,29 @@
[[
AVAudioSession
sharedInstance
]
setDelegate
:
self
];
}
-
(
BOOL
)
_blobCheck
{
NSArray
*
searchPaths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
);
NSString
*
directoryPath
=
searchPaths
[
0
];
if
(
!
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:[
directoryPath
stringByAppendingPathComponent
:
@"blob.so"
]])
return
NO
;
NSData
*
data
=
[
NSData
dataWithContentsOfFile
:[
directoryPath
stringByAppendingPathComponent
:
@"blob.so"
]];
uint8_t
digest
[
CC_SHA1_DIGEST_LENGTH
];
CC_SHA1
(
data
.
bytes
,
data
.
length
,
digest
);
NSMutableString
*
hash
=
[
NSMutableString
stringWithCapacity
:
CC_SHA1_DIGEST_LENGTH
*
2
];
for
(
unsigned
int
u
=
0
;
u
<
CC_SHA1_DIGEST_LENGTH
;
u
++
)
[
hash
appendFormat
:
@"%02x"
,
digest
[
u
]];
if
([
hash
isEqualToString
:
kBlobHash
])
return
YES
;
else
return
NO
;
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
_mediaPlayer
=
[[
VLCMediaPlayer
alloc
]
init
];
...
...
@@ -198,8 +222,10 @@
case
18903917
:
case
862151013
:
{
[
media
addOptions
:@{
@"no-audio"
:
[
NSNull
null
]}];
APLog
(
@"audio playback disabled because an unsupported codec was found"
);
if
(
!
[
self
_blobCheck
])
{
[
media
addOptions
:@{
@"no-audio"
:
[
NSNull
null
]}];
APLog
(
@"audio playback disabled because an unsupported codec was found"
);
}
break
;
}
...
...
VLC for iOS.xcodeproj/project.pbxproj
View file @
ec6c466b
...
...
@@ -217,6 +217,7 @@
7DEB3B8D1764A4F40038FC70
/* blank@2x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7DEB3B841764A4F40038FC70
/* blank@2x.png */
;
};
7DF65C2D174FF3F400F43330
/* VLCDropboxTableViewCell~iphone.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7DF65C2C174FF3F400F43330
/* VLCDropboxTableViewCell~iphone.xib */
;
};
7DF7CA0717650C2A00C61739
/* AVFoundation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7DF7CA0617650C2A00C61739
/* AVFoundation.framework */
;
};
7DF7CA091765475100C61739
/* libcommonCrypto.dylib in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7DF7CA081765475100C61739
/* libcommonCrypto.dylib */
;
};
7DF7E791175F47DC0018858D
/* MediaPlayer.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7DF7E790175F47DC0018858D
/* MediaPlayer.framework */
;
};
A7035BBE174519600057DFA7
/* iTunesArtwork in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7035BBD174519600057DFA7
/* iTunesArtwork */
;
};
A7924696170F0BA90036AAF2
/* libMediaLibraryKit.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7924695170F0BA90036AAF2
/* libMediaLibraryKit.a */
;
};
...
...
@@ -580,6 +581,7 @@
7DEB3B841764A4F40038FC70
/* blank@2x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"blank@2x.png"
;
sourceTree
=
"<group>"
;
};
7DF65C2C174FF3F400F43330
/* VLCDropboxTableViewCell~iphone.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
name
=
"VLCDropboxTableViewCell~iphone.xib"
;
path
=
"../Resources/VLCDropboxTableViewCell~iphone.xib"
;
sourceTree
=
"<group>"
;
};
7DF7CA0617650C2A00C61739
/* AVFoundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
AVFoundation.framework
;
path
=
System/Library/Frameworks/AVFoundation.framework
;
sourceTree
=
SDKROOT
;
};
7DF7CA081765475100C61739
/* libcommonCrypto.dylib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"compiled.mach-o.dylib"
;
name
=
libcommonCrypto.dylib
;
path
=
usr/lib/system/libcommonCrypto.dylib
;
sourceTree
=
SDKROOT
;
};
7DF7E790175F47DC0018858D
/* MediaPlayer.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
MediaPlayer.framework
;
path
=
System/Library/Frameworks/MediaPlayer.framework
;
sourceTree
=
SDKROOT
;
};
A7035BBD174519600057DFA7
/* iTunesArtwork */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
iTunesArtwork
;
sourceTree
=
"<group>"
;
};
A7924695170F0BA90036AAF2
/* libMediaLibraryKit.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
name
=
libMediaLibraryKit.a
;
path
=
External/MediaLibraryKit/libMediaLibraryKit.a
;
sourceTree
=
"<group>"
;
};
...
...
@@ -631,6 +633,7 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
7DF7CA091765475100C61739
/* libcommonCrypto.dylib in Frameworks */
,
7DF7CA0717650C2A00C61739
/* AVFoundation.framework in Frameworks */
,
7DF7E791175F47DC0018858D
/* MediaPlayer.framework in Frameworks */
,
7D6B08FA174D716200A05173
/* MessageUI.framework in Frameworks */
,
...
...
@@ -1130,6 +1133,7 @@
7D94FCDD16DE7D1000F2623B
/* Frameworks */
=
{
isa
=
PBXGroup
;
children
=
(
7DF7CA081765475100C61739
/* libcommonCrypto.dylib */
,
7DF7CA0617650C2A00C61739
/* AVFoundation.framework */
,
7DF7E790175F47DC0018858D
/* MediaPlayer.framework */
,
7D6B08F9174D716200A05173
/* MessageUI.framework */
,
...
...
@@ -1774,6 +1778,7 @@
"$(inherited)"
,
"\"$(SRCROOT)/External/MediaLibraryKit\""
,
"\"$(SRCROOT)/External/MobileVLCKit\""
,
"\"$(SDKROOT)/usr/lib/system\""
,
);
ONLY_ACTIVE_ARCH
=
YES
;
PRODUCT_NAME
=
"VLC for iOS"
;
...
...
@@ -1807,6 +1812,7 @@
"$(inherited)"
,
"\"$(SRCROOT)/External/MediaLibraryKit\""
,
"\"$(SRCROOT)/External/MobileVLCKit\""
,
"\"$(SDKROOT)/usr/lib/system\""
,
);
ONLY_ACTIVE_ARCH
=
NO
;
PRODUCT_NAME
=
"VLC for iOS"
;
...
...
@@ -1867,6 +1873,7 @@
"$(inherited)"
,
"\"$(SRCROOT)/External/MediaLibraryKit\""
,
"\"$(SRCROOT)/External/MobileVLCKit\""
,
"\"$(SDKROOT)/usr/lib/system\""
,
);
ONLY_ACTIVE_ARCH
=
NO
;
PRODUCT_NAME
=
"VLC for iOS"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment