summaryrefslogtreecommitdiff
path: root/apps/system
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-11-10 10:58:14 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-11-10 10:58:14 -0600
commit87ad4a0e04a1b4220918c72191f6ea18e3dc267d (patch)
treeda9b6c1bd830dbbf5291b29795f851000035b95e /apps/system
parent698a61cb7c2100190111fe607dcdd658aad3bb5b (diff)
downloadnuttx-87ad4a0e04a1b4220918c72191f6ea18e3dc267d.tar.gz
nuttx-87ad4a0e04a1b4220918c72191f6ea18e3dc267d.tar.bz2
nuttx-87ad4a0e04a1b4220918c72191f6ea18e3dc267d.zip
NxPlayer play thread stack size is now configurable; all NxPlayer threads are named via pthread_setname_np(). From Ken Pettit
Diffstat (limited to 'apps/system')
-rw-r--r--apps/system/nxplayer/Kconfig6
-rw-r--r--apps/system/nxplayer/Makefile2
-rw-r--r--apps/system/nxplayer/nxplayer.c13
3 files changed, 18 insertions, 3 deletions
diff --git a/apps/system/nxplayer/Kconfig b/apps/system/nxplayer/Kconfig
index 0c366caa5..31362ba3b 100644
--- a/apps/system/nxplayer/Kconfig
+++ b/apps/system/nxplayer/Kconfig
@@ -11,6 +11,12 @@ config SYSTEM_NXPLAYER
if SYSTEM_NXPLAYER
+config NXPLAYER_PLAYTHREAD_STACKSIZE
+ int "NxPlayer thread stack size"
+ default 1500
+ ---help---
+ Stack size to use with the NxPlayer play thread.
+
config NXPLAYER_COMMAND_LINE
bool "Include nxplayer command line application"
default y
diff --git a/apps/system/nxplayer/Makefile b/apps/system/nxplayer/Makefile
index bcdcbfc0e..8de9d4b02 100644
--- a/apps/system/nxplayer/Makefile
+++ b/apps/system/nxplayer/Makefile
@@ -52,7 +52,7 @@ CSRCS = nxplayer.c
APPNAME = nxplayer
PRIORITY = SCHED_PRIORITY_DEFAULT
-STACKSIZE = 3100
+STACKSIZE = 2048
ifeq ($(CONFIG_NXPLAYER_COMMAND_LINE),y)
CSRCS += nxplayer_main.c
diff --git a/apps/system/nxplayer/nxplayer.c b/apps/system/nxplayer/nxplayer.c
index c39900cce..1c0f66c8a 100644
--- a/apps/system/nxplayer/nxplayer.c
+++ b/apps/system/nxplayer/nxplayer.c
@@ -72,6 +72,10 @@
# define CONFIG_NXPLAYER_MSG_PRIO 1
#endif
+#ifndef CONFIG_NXPLAYER_PLAYTHREAD_STACKSIZE
+# define CONFIG_NXPLAYER_PLAYTHREAD_STACKSIZE 1500
+#endif
+
/****************************************************************************
* Private Type Declarations
****************************************************************************/
@@ -1323,7 +1327,8 @@ int nxplayer_playfile(FAR struct nxplayer_s *pPlayer, char* pFilename, int filef
pthread_attr_init(&tattr);
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 9;
- pthread_attr_setschedparam(&tattr, &sparam);
+ (void)pthread_attr_setschedparam(&tattr, &sparam);
+ (void)pthread_attr_setstacksize(&tattr, CONFIG_NXPLAYER_PLAYTHREAD_STACKSIZE);
/* Add a reference count to the player for the thread and start the
* thread. We increment for the thread to avoid thread start-up
@@ -1332,13 +1337,17 @@ int nxplayer_playfile(FAR struct nxplayer_s *pPlayer, char* pFilename, int filef
nxplayer_reference(pPlayer);
ret = pthread_create(&pPlayer->playId, &tattr, nxplayer_playthread,
- (pthread_addr_t) pPlayer);
+ (pthread_addr_t) pPlayer);
if (ret != OK)
{
auddbg("Error %d creating playthread\n", ret);
goto err_out;
}
+ /* Name the thread */
+
+ pthread_setname_np(pPlayer->playId, "playthread");
+
return OK;
err_out: