From: Seungbae Shin Date: Fri, 16 Dec 2016 12:10:13 +0000 (+0900) Subject: Skip update routing when notification comes while radio is highest priority stream X-Git-Tag: accepted/tizen/3.0/common/20161221.180741~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d5288303e6383b0048c77af851085558912ddb7;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git Skip update routing when notification comes while radio is highest priority stream [Version] 5.0.107 [Profile] Common [Issue Type] PLM Change-Id: I4627718302ed8369203c5aed725fa47e1e822ece --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index 15e1b6b..73770c6 100644 --- a/packaging/pulseaudio-modules-tizen.spec +++ b/packaging/pulseaudio-modules-tizen.spec @@ -1,6 +1,6 @@ Name: pulseaudio-modules-tizen Summary: Pulseaudio modules for Tizen -Version: 5.0.106 +Version: 5.0.107 Release: 0 Group: Multimedia/Audio License: LGPL-2.1+ diff --git a/src/stream-manager.c b/src/stream-manager.c index e71fa19..6b503dc 100644 --- a/src/stream-manager.c +++ b/src/stream-manager.c @@ -1879,6 +1879,25 @@ static bool update_volume_type_of_stream(pa_stream_manager *m, void *stream, str return ret; } +/* FIXME : this code is workaround code and needed to be revised soon */ +static void _enable_focus_status_if_radio(void *stream, stream_type_t type, bool is_new_data) +{ + const char *prop_media_role = NULL; + pa_proplist* p = NULL; + + p = (is_new_data ? GET_STREAM_NEW_PROPLIST(stream, type) : GET_STREAM_PROPLIST(stream, type)); + if (!p) + return; + + prop_media_role = pa_proplist_gets(p, PA_PROP_MEDIA_ROLE); + if (prop_media_role) { + if (pa_safe_streq(prop_media_role, STREAM_ROLE_RADIO)) { + pa_log_info("This stream is radio, update focus status to 1"); + pa_proplist_setf(p, PA_PROP_MEDIA_FOCUS_STATUS, "%u", 1); + } + } +} + static bool update_focus_status_of_stream(pa_stream_manager *m, void *stream, stream_type_t type, bool is_new_data) { const char *p_idx; uint32_t parent_idx = 0; @@ -1898,6 +1917,10 @@ static bool update_focus_status_of_stream(pa_stream_manager *m, void *stream, st pa_proplist_setf(GET_STREAM_NEW_PROPLIST(stream, type), PA_PROP_MEDIA_FOCUS_STATUS, "%u", sp->focus_status); else pa_proplist_setf(GET_STREAM_PROPLIST(stream, type), PA_PROP_MEDIA_FOCUS_STATUS, "%u", sp->focus_status); + + /* FIXME : If stream is radio, then fix focus_status to 1 */ + _enable_focus_status_if_radio(stream, type, is_new_data); + pa_log_debug("p_idx(%s), idx(%u), focus_status(0x%x, 0x1:playback 0x2:capture 0x3:both)", p_idx, parent_idx, sp->focus_status); } else { pa_log_error("could not find matching client for this parent_id(%u)", parent_idx);