From: Sangchul Lee Date: Wed, 1 Nov 2017 00:31:14 +0000 (+0900) Subject: focus_server: copy pid of node that will be used for session backward compatibility X-Git-Tag: accepted/tizen/unified/20171108.063447~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20f3f1f440b7b4c130bc7a5dc3e9967873971a9e;p=platform%2Fcore%2Fmultimedia%2Flibmm-sound.git focus_server: copy pid of node that will be used for session backward compatibility This pid information will be used to each multimedia framework to keep session behavior. [Version] 0.11.31 [Issue Type] backward compatibility Change-Id: I4f52b7f29d28b1f5d3ad0388e2df42f6d3bf32aa Signed-off-by: Sangchul Lee --- diff --git a/focus_server/mm_sound_mgr_focus.c b/focus_server/mm_sound_mgr_focus.c index bd1b280..5aaea0c 100644 --- a/focus_server/mm_sound_mgr_focus.c +++ b/focus_server/mm_sound_mgr_focus.c @@ -990,8 +990,19 @@ int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type *stream_type = node->stream_type; *option = node->option[index]; - if (ext_info) - *ext_info = node->ext_info[index]; + if (ext_info) { + if (focus_type != FOCUS_TYPE_BOTH) { + *ext_info = node->ext_info[index]; + } else { + /* In case of FOCUS_TYPE_BOTH, it should be used only for + * session backward compatibility. ext_info will contain pid of the node */ + gchar *buf = g_strdup_printf("%d", node->pid); + if (buf) { + *ext_info = buf; + debug_msg("copied node->pid to ext_info [%s]", *ext_info); + } + } + } ret = MM_ERROR_NONE; break; } diff --git a/focus_server/mm_sound_mgr_focus_dbus.c b/focus_server/mm_sound_mgr_focus_dbus.c index 36c2a5d..24a4989 100644 --- a/focus_server/mm_sound_mgr_focus_dbus.c +++ b/focus_server/mm_sound_mgr_focus_dbus.c @@ -7,6 +7,7 @@ #include +#include "include/mm_sound_mgr_focus.h" #include "include/mm_sound_mgr_focus_dbus.h" #include "include/mm_sound_mgr_focus_ipc.h" #include "../include/mm_sound_dbus.h" @@ -384,6 +385,12 @@ send_reply: else _method_call_return_error(invocation, ret); + /* In case of FOCUS_TYPE_BOTH, it should be used only for + * session backward compatibility. ext_info contains pid of the node, + * and should be freed here. */ + if (focus_type == FOCUS_TYPE_BOTH && ext_info) + g_free(ext_info); + debug_fleave(); } diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 674d968..700caa8 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.11.30 +Version: 0.11.31 Release: 0 Group: System/Libraries License: Apache-2.0