bluetooth: Fix build warnings 78/149178/1 accepted/tizen/4.0/unified/20170913.002649 submit/tizen_4.0/20170912.051928 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 12 Sep 2017 00:58:55 +0000 (09:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 12 Sep 2017 01:02:15 +0000 (10:02 +0900)
Change-Id: Ia34ada98ec90dcf6c208fb899010a61bc9f6a6e5
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/modules/bluetooth/module-bluez5-device.c

index 809607b..2e64235 100644 (file)
 #include <pulsecore/thread-mq.h>
 #include <pulsecore/time-smoother.h>
 
+#ifdef __TIZEN_BT__
+#include <pulsecore/sink.h>
+#include <pulsecore/namereg.h>
+#endif
+
 #include "a2dp-codecs.h"
 #include "bluez5-util.h"
 #include "rtp.h"
@@ -2326,28 +2331,27 @@ static pa_hook_result_t device_connection_changed_cb(pa_bluetooth_discovery *y,
 }
 
 #ifdef __TIZEN_BT__
-void dbus_sco_open_handler(struct userdata *u, struct pa_bluetooth_transport *t)
+static void dbus_sco_open_handler(struct userdata *u, struct pa_bluetooth_transport *t)
 {
     if (u->sink) {
-            pa_log_info("Suspending sink %s to handle the SCO connection", u->sink->name);
-
-            pa_sink *sink_null = NULL;
-            pa_sink_input *si;
-            uint32_t idx;
+        pa_sink *sink_null;
+        pa_sink_input *si;
+        uint32_t idx;
 
-            if (pa_sink_check_suspend(u->sink) > 0) {
-                 sink_null = (pa_sink *)pa_namereg_get(u->core, "null", 0);
+        pa_log_info("Suspending sink %s to handle the SCO connection", u->sink->name);
 
-                                if (sink_null)
-                                {
-                                        PA_IDXSET_FOREACH(si, u->core->sink_inputs, idx) {
-                                                pa_sink_input_move_to(si, sink_null, false);
-                                        }
-                                }
-                       }
+        if (pa_sink_check_suspend(u->sink) > 0) {
+            sink_null = (pa_sink *)pa_namereg_get(u->core, "null", 0);
 
-            pa_sink_suspend(u->sink, true, PA_SUSPEND_INTERNAL);
+            if (sink_null) {
+                PA_IDXSET_FOREACH(si, u->core->sink_inputs, idx) {
+                    pa_sink_input_move_to(si, sink_null, false);
+                }
+            }
         }
+
+        pa_sink_suspend(u->sink, true, PA_SUSPEND_INTERNAL);
+    }
 }
 
 /* Run from main thread */