make pa-ready as feature 27/87627/1
authorMok Jeongho <jho.mok@samsung.com>
Thu, 8 Sep 2016 07:32:56 +0000 (16:32 +0900)
committerMok Jeongho <jho.mok@samsung.com>
Fri, 9 Sep 2016 02:11:51 +0000 (11:11 +0900)
[Version] 5.0-88
[Profile] Common
[Issue Type] Build

Change-Id: I0960f5f8953f0b48b84417a91933b1d0242ba139

configure.ac
packaging/pulseaudio.spec
src/Makefile.am
src/daemon/main.c

index 9efce9f..bb7a368 100644 (file)
@@ -730,6 +730,17 @@ AC_ARG_ENABLE(prelink, AC_HELP_STRING([--enable-prelink], [enable pre-link featu
  ],[USE_PRELINK=no])
 AM_CONDITIONAL([USE_PRELINK], [test "x$USE_PRELINK" = "xyes"])
 
+#### pulseaudio-ready option ####
+AC_ARG_ENABLE(paready, AC_HELP_STRING([--enable-paready], [enable pulseaudio-ready feature]),
+[
+ case "${enableval}" in
+     yes) USE_PA_READY=yes ;;
+     no)  USE_PA_READY=no ;;
+     *)   AC_MSG_ERROR(bad value ${enableval} for --enable-paready) ;;
+ esac
+ ],[USE_PA_READY=no])
+AM_CONDITIONAL([USE_PA_READY], [test "x$USE_PA_READY" = "xyes"])
+
 #### light-weight ipc support  ####
 AC_ARG_ENABLE(lwipc, AC_HELP_STRING([--enable-lwipc], [enable light weight ipc]),
 [
index 17bfca9..4a6f022 100644 (file)
@@ -10,7 +10,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          87
+Release:          88
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
 URL:              http://pulseaudio.org
@@ -265,7 +265,8 @@ NOCONFIGURE=yes ./bootstrap.sh
         --with-system-user=pulse \
         --with-system-group=pulse \
         --with-access-group=pulse-access \
-        --enable-security
+        --enable-security \
+        --enable-paready
 
 %__make %{?_smp_mflags} V=0
 
index 3c9ef85..e19bc5c 100644 (file)
@@ -190,6 +190,10 @@ pulseaudio_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@P
 # This is needed because automake doesn't properly expand the foreach below
 pulseaudio_DEPENDENCIES = libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la $(PREOPEN_LIBS)
 
+if USE_PA_READY
+pulseaudio_CFLAGS += -DUSE_PA_READY
+endif
+
 if USE_LWIPC
 pulseaudio_CFLAGS += $(LWIPC_CFLAGS) -DUSE_LWIPC
 pulseaudio_LDADD += $(LWIPC_LIBS)
index 8405bc6..41311fd 100755 (executable)
@@ -99,7 +99,7 @@
 #include <pulsecore/cpu-x86.h>
 #include <pulsecore/cpu-orc.h>
 
-#if defined (TIZEN_PROFILE_TV) && defined (USE_LWIPC)
+#if defined (USE_PA_READY) && defined (USE_LWIPC)
 #include <lwipc.h>
 #endif
 #include "cmdline.h"
 #include "server-lookup.h"
 
 #ifdef __TIZEN__
-#define PA_READY "/tmp/.pa_ready"
-#ifdef TIZEN_PROFILE_TV
+#ifdef USE_PA_READY
 #ifdef USE_LWIPC
-#define PULSEAUDIO_READY "pulseaudio_ready"
+#define PA_READY "pulseaudio_ready"
 #else
-#define PULSEAUDIO_READY "/tmp/.pulseaudio_ready"
+#define PA_READY "/tmp/.pa_ready"
 #endif
 #endif
 #endif /* __TIZEN__ */
@@ -443,9 +442,8 @@ int main(int argc, char *argv[]) {
 #endif
 
 #ifdef __TIZEN__
+#if defined(USE_PA_READY) && !defined(USE_LWIPC)
     int fd_pa_ready = -1;
-#ifdef TIZEN_PROFILE_TV
-    int fd_pulseaudio_ready = -1;
 #endif
 #endif /* __TIZEN__ */
 
@@ -1203,20 +1201,15 @@ int main(int argc, char *argv[]) {
     pa_log_info(_("Daemon startup complete."));
 #ifdef __TIZEN__
     /* broadcast if we're ready */
-    if ((fd_pa_ready = creat(PA_READY, 0644)) != -1)
-        close(fd_pa_ready);
-#ifdef TIZEN_PROFILE_TV
+#ifdef USE_PA_READY
 #ifdef USE_LWIPC
-    if (LwipcEventDone(PULSEAUDIO_READY) < 0)
+    if (LwipcEventDone(PA_READY) < 0)
         pa_log_error("cannot create PULSEAUDIO_READY(pulseaudio_ready)");
     else
-        pa_log_warn("PULSEAUDIO_READY(%s) event was created", PULSEAUDIO_READY);
+        pa_log_warn("PULSEAUDIO_READY(%s) event was created", PA_READY);
 #else
-    if ((fd_pulseaudio_ready = creat(PULSEAUDIO_READY, 0644)) != -1) {
-        pa_log_warn("PULSEAUDIO_READY(%s) file was created", PULSEAUDIO_READY);
-        close(fd_pulseaudio_ready);
-    } else
-        pa_log_error("cannot create PULSEAUDIO_READY(/tmp/.pulseaudio_ready)");
+    if ((fd_pa_ready = creat(PA_READY, 0644)) != -1)
+        close(fd_pa_ready);
 #endif
 #endif
 #endif /* __TIZEN__ */