Fix build warnings 51/131151/6 accepted/tizen/unified/20170531.082625 submit/tizen/20170526.083733
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 25 May 2017 12:51:00 +0000 (21:51 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 26 May 2017 07:12:07 +0000 (07:12 +0000)
Additionally, replaced some remaing words "zero pop" with "empty pop" for clear meanings

[Version] 5.0.118
[Profile] Common
[Issue Type] Clean up

Change-Id: I15f714d5a4c8fe731a428441987b7d2dcd46d2fd

packaging/pulseaudio.spec
src/daemon/daemon-conf.c
src/daemon/daemon-conf.h
src/daemon/main.c
src/modules/alsa/alsa-sink.c
src/pulsecore/core.c
src/pulsecore/core.h
src/pulsecore/mutex-posix.c
src/pulsecore/protocol-native.c
src/pulsecore/sink-input.c

index 7165abb..74a40ee 100644 (file)
@@ -12,7 +12,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          117
+Release:          118
 Group:            Multimedia/Audio
 License:          LGPL-2.1
 URL:              http://pulseaudio.org
index 3845b5d..ace9952 100644 (file)
@@ -69,7 +69,7 @@ static const pa_daemon_conf default_conf = {
     .realtime_scheduling = true,
     .realtime_priority = 5,  /* Half of JACK's default rtprio */
 #ifdef __TIZEN__
-    .zero_pop_threshold = 10,
+    .empty_pop_threshold = 10,
 #endif
     .disallow_module_loading = false,
     .disallow_exit = false,
@@ -539,7 +539,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
         { "scache-idle-time",           pa_config_parse_int,      &c->scache_idle_time, NULL },
         { "realtime-priority",          parse_rtprio,             c, NULL },
 #ifdef __TIZEN__
-        { "zero-pop-threshold",         pa_config_parse_int,      &c->zero_pop_threshold, NULL },
+        { "empty-pop-threshold",        pa_config_parse_unsigned, &c->empty_pop_threshold, NULL },
 #endif
         { "dl-search-path",             pa_config_parse_string,   &c->dl_search_path, NULL },
         { "default-script-file",        pa_config_parse_string,   &c->default_script_file, NULL },
@@ -735,7 +735,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
     pa_strbuf_printf(s, "realtime-scheduling = %s\n", pa_yes_no(c->realtime_scheduling));
     pa_strbuf_printf(s, "realtime-priority = %i\n", c->realtime_priority);
 #ifdef __TIZEN__
-    pa_strbuf_printf(s, "zero-pop-threshold = %i\n", c->zero_pop_threshold);
+    pa_strbuf_printf(s, "empty-pop-threshold = %u\n", c->empty_pop_threshold);
 #endif
     pa_strbuf_printf(s, "allow-module-loading = %s\n", pa_yes_no(!c->disallow_module_loading));
     pa_strbuf_printf(s, "allow-exit = %s\n", pa_yes_no(!c->disallow_exit));
index 51a478a..acfc83d 100644 (file)
@@ -81,9 +81,6 @@ typedef struct pa_daemon_conf {
     int exit_idle_time,
         scache_idle_time,
         realtime_priority,
-#ifdef __TIZEN__
-        zero_pop_threshold,
-#endif
         nice_level,
         resample_method;
     char *script_commands, *dl_search_path, *default_script_file;
@@ -91,6 +88,9 @@ typedef struct pa_daemon_conf {
     pa_log_level_t log_level;
     unsigned log_backtrace;
     char *config_file;
+#ifdef __TIZEN__
+    unsigned empty_pop_threshold;
+#endif
 
 #ifdef HAVE_SYS_RESOURCE_H
     pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core;
index 3c7d2cc..b293579 100755 (executable)
@@ -1108,7 +1108,7 @@ int main(int argc, char *argv[]) {
 #endif
 
 #ifdef __TIZEN__
-    c->zero_pop_threshold = conf->zero_pop_threshold;
+    c->empty_pop_threshold = conf->empty_pop_threshold;
 #endif
 
     c->cpu_info.cpu_type = PA_CPU_UNDEFINED;
index 1c6ffb7..ae715f8 100644 (file)
@@ -1696,6 +1696,7 @@ static int process_rewind(struct userdata *u) {
         pa_log_debug("Limited to %lu bytes.", (unsigned long) rewind_nbytes);
 
 #ifdef TIZEN_PROFILE_TV
+        in_frames = 0;
         out_frames = 0;
 #else
         in_frames = (snd_pcm_sframes_t) (rewind_nbytes / u->frame_size);
index 2bccac5..10413c0 100644 (file)
@@ -167,7 +167,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, bool shared, size_t shm_size) {
     pa_core_check_idle(c);
 
 #ifdef __TIZEN__
-    c->zero_pop_threshold = 10;
+    c->empty_pop_threshold = 10;
     c->pcm_dump = 0;
     c->pcm_dump_option = 0;
 #endif
index e383b17..c549144 100644 (file)
@@ -228,7 +228,7 @@ struct pa_core {
     pa_hook hooks[PA_CORE_HOOK_MAX];
 
 #ifdef __TIZEN__
-    int zero_pop_threshold;
+    unsigned empty_pop_threshold;
     uint32_t pcm_dump;
     uint32_t pcm_dump_option;
 #endif
index 3e562e1..8228364 100644 (file)
@@ -83,10 +83,12 @@ void pa_mutex_free(pa_mutex *m) {
     pa_assert(m);
 
 #ifdef __TIZEN__
-    int ret = pthread_mutex_destroy(&m->mutex);
-    if (ret != 0)
-        pa_log_error("pthread_mutex_destroy [%p] error [%d]", &m->mutex, ret);
-    pa_assert_se(ret == 0);
+    {
+        int ret = pthread_mutex_destroy(&m->mutex);
+        if (ret != 0)
+            pa_log_error("pthread_mutex_destroy [%p] error [%d]", &m->mutex, ret);
+        pa_assert_se(ret == 0);
+    }
 #else
     pa_assert_se(pthread_mutex_destroy(&m->mutex) == 0);
 #endif
@@ -97,10 +99,12 @@ void pa_mutex_lock(pa_mutex *m) {
     pa_assert(m);
 
 #ifdef __TIZEN__
-    int ret = pthread_mutex_lock(&m->mutex);
-    if (ret != 0)
-        pa_log_error("pthread_mutex_lock [%p] error [%d]", &m->mutex, ret);
-    pa_assert_se(ret == 0);
+    {
+        int ret = pthread_mutex_lock(&m->mutex);
+        if (ret != 0)
+            pa_log_error("pthread_mutex_lock [%p] error [%d]", &m->mutex, ret);
+        pa_assert_se(ret == 0);
+    }
 #else
     pa_assert_se(pthread_mutex_lock(&m->mutex) == 0);
 #endif
@@ -122,10 +126,12 @@ void pa_mutex_unlock(pa_mutex *m) {
     pa_assert(m);
 
 #ifdef __TIZEN__
-    int ret = pthread_mutex_unlock(&m->mutex);
-    if (ret != 0)
-        pa_log_error("pthread_mutex_unlock [%p] error [%d]", &m->mutex, ret);
-    pa_assert_se(ret == 0);
+    {
+        int ret = pthread_mutex_unlock(&m->mutex);
+        if (ret != 0)
+            pa_log_error("pthread_mutex_unlock [%p] error [%d]", &m->mutex, ret);
+        pa_assert_se(ret == 0);
+    }
 #else
     pa_assert_se(pthread_mutex_unlock(&m->mutex) == 0);
 #endif
index 2c5b828..923d18d 100644 (file)
@@ -1792,7 +1792,7 @@ static bool sink_input_process_underrun_cb(pa_sink_input *i) {
 }
 
 #ifdef __TIZEN__
-static void _check_zero_pop_timeout(pa_sink_input *i) {
+static void _check_empty_pop_timeout(pa_sink_input *i) {
     playback_stream *s = PLAYBACK_STREAM(i->userdata);
     bool is_timeout = false;
 
@@ -1819,10 +1819,10 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
 #endif
 
 #ifdef __TIZEN__
-    /* If zero pops exceeds certain threshold, send message to client to handle this situation */
+    /* If empty pops exceeds certain threshold, send message to client to handle this situation */
     /* FIXME: maybe we can use s->is_underrun to check.... */
     if (!i->is_virtual) /* skip for virtual stream */
-        _check_zero_pop_timeout(i);
+        _check_empty_pop_timeout(i);
 #endif
 
     if (!handle_input_underrun(s, false))
index c01d2d8..0063cba 100644 (file)
@@ -35,6 +35,9 @@
 #include <pulse/xmalloc.h>
 #include <pulse/util.h>
 #include <pulse/internal.h>
+#ifdef __TIZEN__
+#include <pulse/rtclock.h>
+#endif
 
 #include <pulsecore/core-format.h>
 #include <pulsecore/mix.h>
@@ -404,7 +407,7 @@ int pa_sink_input_new(
     char *memblockq_name;
     pa_cvolume v;
 #ifdef __TIZEN__
-    char *media_name = NULL;
+    const char *media_name = NULL;
 #endif
 
     pa_assert(_i);
@@ -2458,7 +2461,7 @@ static void _empty_pop_print_duration(pa_sink_input *i, uint32_t empty_pop_durat
     i->empty_pop_previous_duration = empty_pop_duration;
 
     pa_log_debug("[%u] empty pop (no sink-input data) for [%u] sec., timeout is [%u] sec.",
-                  i->index, empty_pop_duration, i->core->zero_pop_threshold);
+                  i->index, empty_pop_duration, i->core->empty_pop_threshold);
 }
 
 static void _empty_pop_reset(pa_sink_input *i) {
@@ -2476,7 +2479,7 @@ void pa_sink_input_update_empty_pop(pa_sink_input *i, size_t length, bool *is_ti
         if (_empty_pop_is_started(i)) {
             /* calculate empty pop duration in seconds */
             uint32_t empty_pop_duration = _empty_pop_calc_duration(i);
-            if (empty_pop_duration >= i->core->zero_pop_threshold) {
+            if (empty_pop_duration >= i->core->empty_pop_threshold) {
                 *is_timeout = true;
                 _empty_pop_reset(i);
                 return;