Skip to content

Commit

Permalink
Merge pull request #9858 from Memphiz/mrmc_backports
Browse files Browse the repository at this point in the history
Mrmc backports
  • Loading branch information
Memphiz committed Jun 3, 2016
2 parents d77bc24 + c51bc8e commit 7ffbade
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
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

0 comments on commit 7ffbade

Please sign in to comment.