From: Sangchul Lee Date: Tue, 19 May 2020 01:32:38 +0000 (+0900) Subject: stream-manager: Select new proper device even if sink or source of new data is set X-Git-Tag: submit/tizen/20200529.085112^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41b023359a6e124e6c2cbb5f9523934fb19532b6;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git stream-manager: Select new proper device even if sink or source of new data is set In tizen policy, selecting device is performed in tizenaudio-policy module. The previous codes skip selecting the device logic if sink or source of new data is defined(probably aka default sink/source) in somewhere before the codes. This patch set it regardless of this matter. We need to be aware of this modification for possible issues regarding it. If the skip logic is needed anyway later, we may put that in another place. [Version] 13.0.17 [Issue Type] Bug fix Change-Id: I92df553b259d8ae1ff9de6c29723ccbb78bfaee6 Signed-off-by: Sangchul Lee --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index 0cab8a7..64e1ab1 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: 13.0.16 +Version: 13.0.17 Release: 0 Group: Multimedia/Audio License: LGPL-2.1+ diff --git a/src/stream-manager.c b/src/stream-manager.c index 6411be7..cb89244 100644 --- a/src/stream-manager.c +++ b/src/stream-manager.c @@ -1680,7 +1680,6 @@ static ret_msg_t prepare_and_invoke_hook_to_select_device(pa_stream_manager *m, fill_device_info_to_hook_data(m, &hook_call_select_data, command, type, s, is_new_data); hook_call_select_data.sample_spec = GET_STREAM_NEW_SAMPLE_SPEC(s, type); if (type == STREAM_SINK_INPUT) { - const char *modifier_gain = NULL; hook_call_select_data.occupying_role = m->cur_highest_priority.role_si; if (IS_ROLE_COMMUNICATION(hook_call_select_data.occupying_role)) { /* Currently, if bt-sco is used by communication stream, other streams can not go with bt-a2dp. @@ -1689,21 +1688,9 @@ static ret_msg_t prepare_and_invoke_hook_to_select_device(pa_stream_manager *m, hook_call_select_data.idx_avail_devices = filtered_avail_devices; } hook_call_select_data.proper_sink = &(((pa_sink_input_new_data*)s)->sink); - /* need to check modifier_gain, because we do not skip a stream that is from module-sound-player */ - modifier_gain = pa_proplist_gets(GET_STREAM_NEW_PROPLIST(s, type), PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE); - if (((pa_sink_input_new_data*)s)->sink && !modifier_gain) { - pa_log_info(" - sink(%s) has been already selected, skip selecting sink", - (((pa_sink_input_new_data*)s)->sink)->name); - goto BREAK_WITH_FREE; - } } else if (type == STREAM_SOURCE_OUTPUT) { hook_call_select_data.occupying_role = m->cur_highest_priority.role_so; hook_call_select_data.proper_source = &(((pa_source_output_new_data*)s)->source); - if (((pa_source_output_new_data*)s)->source) { - pa_log_info(" - source(%s) has been already selected, skip selecting source", - (((pa_source_output_new_data*)s)->source)->name); - return ret; - } } } else { hook_call_select_data.stream_role = pa_proplist_gets(GET_STREAM_PROPLIST(s, type), @@ -1726,7 +1713,7 @@ static ret_msg_t prepare_and_invoke_hook_to_select_device(pa_stream_manager *m, pa_source_output_move_to(PA_SOURCE_OUTPUT(s), hook_call_select_data.new_source, false); } } -BREAK_WITH_FREE: + pa_xfree(filtered_avail_devices); return ret;