stream-manager: Add more conditions in CheckStreamExistByPid Dbus method 29/127129/2 tizen_3.0
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 21 Apr 2017 07:24:01 +0000 (16:24 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 27 Apr 2017 01:12:09 +0000 (10:12 +0900)
Added conditions to comply session backward compatibility.
 - exclude openAL
 - check client pid of muse-server also

[Version] 5.0.144
[Profile] Common
[Issue Type] Backward compatibility

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

index 5fe479e5c634783591267777696e2c98fcf58371..74668b6b3adc7b08eb42c15d07f00f3c5a6c47f3 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.143
+Version:          5.0.144
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 18c4b01f88c5c6838e5a72af792f3ae4cb01db13..95a1a5f4ab5ea1531fcb804e4e9e928a49a13638 100644 (file)
@@ -1026,6 +1026,7 @@ static void set_initial_active_device(pa_stream_manager *m) {
     set_media_active_device(m);
 }
 
+#define PA_PROP_MEDIA_FROM    "media.from" /* It will be removed when the session concept is completely left out */
 static bool check_stream_exist_by_pid(pa_stream_manager *m, uint32_t pid, const char *stream_role, stream_type_t type) {
     void *stream = NULL;
     uint32_t idx = 0;
@@ -1051,7 +1052,26 @@ static bool check_stream_exist_by_pid(pa_stream_manager *m, uint32_t pid, const
         app_pid_str = pa_proplist_gets(GET_STREAM_PROPLIST(stream, type), PA_PROP_APPLICATION_PROCESS_ID);
         if (app_pid_str && !pa_atou(app_pid_str, &app_pid)) {
             if (app_pid == pid) {
+                const char *media_from = NULL;
                 pa_log_info("found matching stream(%p, index:%u)", stream, GET_STREAM_INDEX(stream, type));
+
+                /* This is an exception case for session backward compatibility,
+                 * It will be removed when the session concept is completely left out. */
+                media_from = pa_proplist_gets(GET_STREAM_PROPLIST(stream, type), PA_PROP_MEDIA_FROM);
+                if (pa_safe_streq(media_from, "openAL")) {
+                    pa_log_info("stream(%p, index:%u) is from openAL, skip it.", stream, GET_STREAM_INDEX(stream, type));
+                    continue;
+                }
+
+                return true;
+            }
+        }
+
+        /* Here we checks muse-server client pid also. It will be removed when the session concept is completely left out. */
+        app_pid_str = pa_proplist_gets(GET_STREAM_PROPLIST(stream, type), "mused.client_pid");
+        if (app_pid_str && !pa_atou(app_pid_str, &app_pid)) {
+            if (app_pid == pid) {
+                pa_log_info("found matching stream(%p, index:%u) of muse-server", stream, GET_STREAM_INDEX(stream, type));
                 return true;
             }
         }