stream-manager: Add more conditions in CheckStreamExistByPid Dbus method 23/128423/1
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 21 Apr 2017 07:24:01 +0000 (16:24 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 10 May 2017 02:56:46 +0000 (11:56 +0900)
Added conditions to comply session backward compatibility.
 - exclude openAL
 - check client pid of muse-server also

[Version] 5.0.146
[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 6b7fc4fdfdf609f720f8d87103e9d214a2fde76f..b113a4a099d16e22814e316004e2b5da88fcc20f 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.145
+Version:          5.0.146
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 2e97ee8e305c983599bf8c0a415797ad1cc99d0b..cb52d512b41f1e1952404dae5c18eae93a90f355 100644 (file)
@@ -1081,6 +1081,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;
@@ -1106,7 +1107,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;
             }
         }