Skip to content

Commit

Permalink
fixed, another json stack blowup on tvOS. CTCPServer needs some love too
Browse files Browse the repository at this point in the history
  • Loading branch information
davilla authored and Memphiz committed May 22, 2016
1 parent 5f5b1da commit 309d77c
Showing 1 changed file with 14 additions and 1 deletion.
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

0 comments on commit 309d77c

Please sign in to comment.