Fix SVACE defects 66/82966/2 accepted/tizen/common/20160811.145655 accepted/tizen/ivi/20160812.010636 accepted/tizen/mobile/20160812.010703 accepted/tizen/tv/20160812.010613 accepted/tizen/wearable/20160812.010543 submit/tizen/20160810.075454 submit/tizen/20160811.023523
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 8 Aug 2016 10:14:08 +0000 (19:14 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 8 Aug 2016 10:27:38 +0000 (19:27 +0900)
[Version] 5.0-85
[Profile] Common
[Issue Type] SVACE

Change-Id: I5d33d98f09fed0b544e9b6aaf275797a069ef85d

packaging/pulseaudio.spec
src/daemon/main.c
src/modules/alsa/alsa-util.c
src/modules/bluetooth/module-bluez5-device.c
src/pulsecore/ffmpeg/resample2.c
src/pulsecore/sink-input.c
src/pulsecore/source-output.c

index abbc13f..79ba165 100644 (file)
@@ -10,7 +10,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          84
+Release:          85
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
 URL:              http://pulseaudio.org
index ee7a24a..7ab9b9a 100755 (executable)
 #include "ltdl-bind-now.h"
 #include "server-lookup.h"
 
+#ifdef __TIZEN__
 #define PA_READY "/tmp/.pa_ready"
 #ifdef TIZEN_TV
 #define PULSEAUDIO_READY "/tmp/.pulseaudio_ready"
 #endif
+#endif /* __TIZEN__ */
 #ifdef HAVE_LIBWRAP
 /* Only one instance of these variables */
 int allow_severity = LOG_INFO;
@@ -433,6 +435,13 @@ int main(int argc, char *argv[]) {
     bool start_server;
 #endif
 
+#ifdef __TIZEN__
+    int fd_pa_ready = -1;
+#ifdef TIZEN_TV
+    int fd_pulseaudio_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);
@@ -1185,14 +1194,19 @@ int main(int argc, char *argv[]) {
 #endif
 
     pa_log_info(_("Daemon startup complete."));
+#ifdef __TIZEN__
     /* broadcast if we're ready */
-    creat(PA_READY, 0644);
+    if ((fd_pa_ready = creat(PA_READY, 0644)) != -1)
+        close(fd_pa_ready);
 #ifdef TIZEN_TV
-    if (creat(PULSEAUDIO_READY, 0644) != -1)
+    if ((fd_pulseaudio_ready = creat(PULSEAUDIO_READY, 0644)) != -1) {
         pa_log_warn("PULSEAUDIO_READY(%s) file was created", PULSEAUDIO_READY);
-    else
+        close(fd_pulseaudio_ready);
+    } else {
         pa_log_error("cannot create PULSEAUDIO_READY(/tmp/.pulseaudio_ready)");
+    }
 #endif
+#endif /* __TIZEN__ */
     retval = 0;
     if (pa_mainloop_run(mainloop, &retval) < 0)
         goto finish;
index c20755a..39ab3ed 100644 (file)
@@ -447,9 +447,6 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool peri
     snd_pcm_sw_params_t *swparams;
     snd_pcm_uframes_t boundary;
     int err;
-#ifdef __TIZEN__
-    snd_pcm_uframes_t stop_threshold = 0;
-#endif
 
     pa_assert(pcm);
 
@@ -486,7 +483,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool peri
     }
 
 #ifdef __TIZEN__
-    if ((err = snd_pcm_sw_params_set_stop_threshold(pcm, swparams, (stop_threshold)? stop_threshold:boundary)) < 0) {
+    if ((err = snd_pcm_sw_params_set_stop_threshold(pcm, swparams, boundary)) < 0) {
         pa_log_warn("Unable to set stop threshold: %s\n", pa_alsa_strerror(err));
         return err;
     }
index 739c492..332b21a 100644 (file)
@@ -2461,9 +2461,7 @@ int pa__init(pa_module* m) {
     if (add_card(u) < 0)
         goto fail;
 
-#ifdef __TIZEN_BT__
-    pa_modargs_free(ma);
-#endif
+
     if (!(u->msg = pa_msgobject_new(bluetooth_msg)))
         goto fail;
 
@@ -2478,6 +2476,9 @@ int pa__init(pa_module* m) {
            pa_load_aptx_sym(handle);
     }
 #endif
+#ifdef __TIZEN_BT__
+    pa_modargs_free(ma);
+#endif
 
     if (u->profile != PA_BLUETOOTH_PROFILE_OFF)
         if (init_profile(u) < 0)
index 09ec34a..d71fef2 100644 (file)
@@ -213,7 +213,7 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
     av_build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE);
 #else // PRELOAD_FILTER
     char filter_data_name[256];
-    sprintf (filter_data_name, "%s/filter_%d_%d.dat", PRE_FILTER_TABLE_PATH, in_rate, out_rate);
+    pa_snprintf (filter_data_name, sizeof(filter_data_name), "%s/filter_%d_%d.dat", PRE_FILTER_TABLE_PATH, in_rate, out_rate);
 
 #ifdef DEBUG_MODE
     printf ("filter_data_name = %s\n", filter_data_name);
index 0d24bb9..1f4d4ae 100644 (file)
@@ -1110,12 +1110,15 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
     /* open file for dump pcm */
     if (i->core->dump_sink_input && !i->dump_fp) {
         time_t t;
+        struct tm tm;
         char datetime[12];
         char *dump_path = NULL;
 
         time(&t);
+        tzset();
+        localtime_r(&t, &tm);
         memset(&datetime[0], 0x00, sizeof(datetime));
-        strftime(&datetime[0], sizeof(datetime), "%m%d_%H%M%S", localtime(&t));
+        strftime(&datetime[0], sizeof(datetime), "%m%d_%H%M%S", &tm);
         dump_path = pa_sprintf_malloc("%s_%s_%d_sink%d.pcm", PA_SINK_INPUT_DUMP_PATH_PREFIX, &datetime[0], i->index, i->sink->index);
 
         if (dump_path) {
index c505a7c..621c955 100644 (file)
@@ -889,12 +889,15 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
     /* open file for dump pcm */
     if (o->core->dump_source_output && !o->dump_fp) {
         time_t t;
+        struct tm tm;
         char datetime[12];
         char *dump_path = NULL;
 
         time(&t);
+        tzset();
+        localtime_r(&t, &tm);
         memset(&datetime[0], 0x00, sizeof(datetime));
-        strftime(&datetime[0], sizeof(datetime), "%m%d_%H%M%S", localtime(&t));
+        strftime(&datetime[0], sizeof(datetime), "%m%d_%H%M%S", &tm);
         dump_path = pa_sprintf_malloc("%s_%s_%d_source%d.pcm", PA_SOURCE_OUTPUT_DUMP_PATH_PREFIX, &datetime[0], o->index, o->source->index);
 
         if (dump_path) {