#include <pulsecore/cpu-x86.h>
#include <pulsecore/cpu-orc.h>
-#if defined (USE_PA_READY) && defined (USE_LWIPC)
-#include <lwipc.h>
-#endif
#include "cmdline.h"
#include "cpulimit.h"
#include "daemon-conf.h"
#include "server-lookup.h"
#ifdef __TIZEN__
-#ifdef USE_PA_READY
+
+#ifdef TIZEN_FEATURE_TV_PROD
#ifdef USE_LWIPC
-#define PA_READY "pulseaudio_ready"
+#include <lwipc.h>
+#define PULSEAUDIO_READY "pulseaudio_ready"
#else
-#define PA_READY "/tmp/.pa_ready"
+#define PULSEAUDIO_READY "/tmp/.pulseaudio_ready"
#endif
+#endif /* TIZEN_FEATURE_TV_PROD */
+
+#ifdef USE_PA_READY
+#define PA_READY "/tmp/.pa_ready"
#endif
+
#endif /* __TIZEN__ */
#ifdef HAVE_LIBWRAP
/* Only one instance of these variables */
}
#endif
+#ifdef __TIZEN__
+static int create_ready_file(const char *path) {
+ int ready_fd = -1;
+
+ if (path == NULL) {
+ pa_log_error("Ready file path is null");
+ return -1;
+ }
+
+ if ((ready_fd = creat(path, 0644)) == -1) {
+ pa_log_error("Failed to create READY FILE(%s) : %s", path, pa_cstrerror(errno));
+ return -1;
+ }
+
+ pa_log_warn("READY FILE (%s) was created", path);
+ close(ready_fd);
+ return 0;
+}
+#endif
+
int main(int argc, char *argv[]) {
pa_core *c = NULL;
pa_strbuf *buf = NULL;
bool start_server;
#endif
-#ifdef __TIZEN__
-#if defined(USE_PA_READY) && !defined(USE_LWIPC)
- int fd_pa_ready = -1;
-#endif
-#endif /* __TIZEN__ */
-
pa_log_set_ident("pulseaudio");
pa_log_set_level(PA_LOG_NOTICE);
pa_log_set_flags(PA_LOG_COLORS|PA_LOG_PRINT_FILE|PA_LOG_PRINT_LEVEL, PA_LOG_RESET);
#ifdef __TIZEN__
/* broadcast if we're ready */
#ifdef USE_PA_READY
+ if (create_ready_file(PA_READY) < 0)
+ pa_log_error("Failed to create ready file(%s) for other audio service", PA_READY);
+#endif
+
+#ifdef TIZEN_FEATURE_TV_PROD
#ifdef USE_LWIPC
- if (LwipcEventDone(PA_READY) < 0)
- pa_log_error("cannot create PULSEAUDIO_READY(pulseaudio_ready)");
+ if (LwipcEventDone(PULSEAUDIO_READY) < 0)
+ pa_log_error("cannot create PULSEAUDIO_READY(%s)", PULSEAUDIO_READY);
else
- pa_log_warn("PULSEAUDIO_READY(%s) event was created", PA_READY);
+ pa_log_warn("PULSEAUDIO_READY(%s) event was created", PULSEAUDIO_READY);
#else
- if ((fd_pa_ready = creat(PA_READY, 0644)) != -1)
- close(fd_pa_ready);
+ if (create_ready_file(PULSEAUDIO_READY) < 0)
+ pa_log_error("Failed to create ready file(%s) for external services", PULSEAUDIO_READY);
#endif
#endif
#endif /* __TIZEN__ */