Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mrmc backports #9858

Merged
merged 5 commits into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion xbmc/network/TCPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,20 @@ bool CTCPServer::StartServer(int port, bool nonlocal)
ServerInstance = new CTCPServer(port, nonlocal);
if (ServerInstance->Initialize())
{
ServerInstance->Create();
size_t thread_stacksize = 0;
#if defined(TARGET_DARWIN_TVOS)
void *stack_addr;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_getstack(&attr, &stack_addr, &thread_stacksize);
pthread_attr_destroy(&attr);
// double the stack size under tvos, not sure why yet
// but it stoped crashing using Kodi json -> play video.
// non-tvos will pass a value of zero which means 'system default'
thread_stacksize *= 2;
CLog::Log(LOGDEBUG, "CTCPServer: increasing thread stack to %zu", thread_stacksize);
#endif
ServerInstance->Create(false, thread_stacksize);
return true;
}
else
Expand Down
23 changes: 18 additions & 5 deletions xbmc/platform/darwin/ios/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
<array>
<string>iPhoneOS</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>BuildMachineOSBuild</key>
<string>15E65</string>
<key>DTPlatformBuild</key>
Expand Down Expand Up @@ -152,5 +147,23 @@
<string>iphoneos</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiresPersistentWiFi</key>
<string>YES</string>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
18 changes: 10 additions & 8 deletions xbmc/platform/darwin/ios/XBMCController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ - (void) deactivateKeyboard:(UIView *)view
//--------------------------------------------------------------
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
{
UITouch *touch = (UITouch *)[[touches allObjects] objectAtIndex:0];
CGPoint point = [touch locationInView:m_glView];
Expand All @@ -372,7 +372,7 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
//--------------------------------------------------------------
-(void)handlePinch:(UIPinchGestureRecognizer*)sender
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING
{
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
Expand All @@ -398,7 +398,7 @@ -(void)handlePinch:(UIPinchGestureRecognizer*)sender
//--------------------------------------------------------------
-(void)handleRotate:(UIRotationGestureRecognizer*)sender
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING
{
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
Expand All @@ -423,11 +423,11 @@ -(void)handleRotate:(UIRotationGestureRecognizer*)sender
//--------------------------------------------------------------
- (IBAction)handlePan:(UIPanGestureRecognizer *)sender
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
{
CGPoint velocity = [sender velocityInView:m_glView];

if( [sender state] == UIGestureRecognizerStateBegan )
if( [sender state] == UIGestureRecognizerStateBegan && sender.numberOfTouches )
{
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
Expand All @@ -436,7 +436,7 @@ - (IBAction)handlePan:(UIPanGestureRecognizer *)sender
lastGesturePoint = point;
}

if( [sender state] == UIGestureRecognizerStateChanged )
if( [sender state] == UIGestureRecognizerStateChanged && sender.numberOfTouches )
{
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
Expand Down Expand Up @@ -484,7 +484,7 @@ - (IBAction)handlePan:(UIPanGestureRecognizer *)sender
//--------------------------------------------------------------
- (IBAction)handleSwipe:(UISwipeGestureRecognizer *)sender
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING
{


Expand Down Expand Up @@ -534,7 +534,7 @@ - (IBAction)handleTap:(UIGestureRecognizer *)sender
//--------------------------------------------------------------
- (IBAction)handleSingleFingerSingleLongTap:(UIGestureRecognizer *)sender
{
if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING
if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches)//NO GESTURES BEFORE WE ARE UP AND RUNNING
{
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
Expand Down Expand Up @@ -567,6 +567,8 @@ - (id)initWithFrame:(CGRect)frame withScreen:(UIScreen *)screen
if ( !self )
return ( nil );

m_glView = NULL;

m_isPlayingBeforeInactive = NO;
m_bgTask = UIBackgroundTaskInvalid;
m_playbackState = IOS_PLAYBACK_STOPPED;
Expand Down