CAudioInfo: Refactor getters to return in group
[platform/core/api/audio-io.git] / src / cpp / CPulseAudioClient.cpp
index 08221ec..7c1796a 100644 (file)
@@ -392,11 +392,11 @@ void CPulseAudioClient::initialize() {
             THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_proplist_new()"); //LCOV_EXCL_LINE
 
         // Adds values on proplist for delivery to PULSEAUDIO
-        pa_proplist_sets(__mpPropList, PA_PROP_MEDIA_ROLE, __mSpec.getAudioInfo().getConvertedStreamType());
+        auto [ streamType, streamIndex ] = __mSpec.getAudioInfo().getStreamProperties();
 
-        int index = __mSpec.getAudioInfo().getAudioIndex();
-        if (index >= 0)
-            pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_PARENT_ID, "%u", (unsigned int) index);
+        pa_proplist_sets(__mpPropList, PA_PROP_MEDIA_ROLE, streamType);
+        if (streamIndex >= 0)
+            pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_PARENT_ID, "%d", streamIndex);
 
         if (__mDirection == EStreamDirection::STREAM_DIRECTION_RECORD) {
             /* Noise-suppression effect should be set first. */