device-manager: Skip notifying change of running state in case of null sink/source... 50/176550/1 accepted/tizen/unified/20180420.152047 submit/tizen/20180420.042319
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 20 Apr 2018 03:22:17 +0000 (12:22 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 20 Apr 2018 03:27:12 +0000 (12:27 +0900)
null sink/source can not be represented as a device of device-manager.

[Version] 11.1.3
[Issue Type] Bug fix

Change-Id: I7e3d353acd703e1da754fd83e374bba33e14b02c
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Makefile.am
packaging/pulseaudio-modules-tizen.spec
src/device-manager.c

index 302282223e2844c6890c8e19c683018fad0f6369..3a10875e5fefd4ed04f0d48585b96dc938ddcbf7 100644 (file)
@@ -26,7 +26,7 @@ AM_CFLAGS = \
 AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
 AM_LDFLAGS = $(NODELETE_LDFLAGS)
 
-MODULE_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS)
+MODULE_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS) -D__TIZEN__
 MODULE_LDFLAGS = $(AM_LDFLAGS) $(PACORE_LDFLAGS) $(PA_LDFLAGS) -module -disable-static -avoid-version
 MODULE_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS)
 
index e6fb21b668bd27aae4e583545097488ce3902070..a4fe972dca53aceae5d69a518066321043f04a76 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.2
+Version:          11.1.3
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 55486b0b1a1bca7b86ba04c2e54fcccd3056d0d3..bcc97e0ab5aa70394e864cb376a72c02abf98c62 100644 (file)
@@ -1769,6 +1769,8 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
     return PA_HOOK_OK;
 }
 
+#define SINK_NAME_NULL "sink_null"
+#define SOURCE_NAME_NULL "source_null"
 static pa_hook_result_t sink_source_state_changed_hook_cb(pa_core *c, pa_object *pdevice, pa_device_manager *dm) {
     pa_tz_device *device;
 
@@ -1780,14 +1782,14 @@ static pa_hook_result_t sink_source_state_changed_hook_cb(pa_core *c, pa_object
         pa_sink *s = PA_SINK(pdevice);
         pa_sink_state_t state = pa_sink_get_state(s);
         pa_log_debug("=========== Sink(%p,%s) state has been changed to [%d](0:RUNNING, 1:IDLE, 2:SUSPEND) ==========", s, s->name, state);
-        if (!s->use_internal_codec)
+        if (!s->use_internal_codec && !pa_streq(s->name, SINK_NAME_NULL))
             if ((device = pa_device_manager_get_device_with_sink(s)))
                 pa_tz_device_set_running_and_notify(device, (state == PA_SINK_RUNNING));
     } else if (pa_source_isinstance(pdevice)) {
         pa_source *s = PA_SOURCE(pdevice);
         pa_source_state_t state = pa_source_get_state(s);
         pa_log_debug("=========== Source(%p,%s) state has been changed to [%d](0:RUNNING, 1:IDLE, 2:SUSPEND) ==========", s, s->name, state);
-        if (!s->use_internal_codec)
+        if (!s->use_internal_codec && !pa_streq(s->name, SOURCE_NAME_NULL))
             if ((device = pa_device_manager_get_device_with_source(s)))
                 pa_tz_device_set_running_and_notify(device, (state == PA_SOURCE_RUNNING));
     }