Fix mismatching between enum and method_table 91/279691/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/hotfix/20221116.105454 accepted/tizen/unified/20220817.153742 submit/tizen/20220816.084510 tizen_7.0_m2_release
authorJaechul Lee <jcsing.lee@samsung.com>
Tue, 16 Aug 2022 07:45:25 +0000 (16:45 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Tue, 16 Aug 2022 08:03:47 +0000 (17:03 +0900)
enums should be matched to method_table because the enum is used as an
index.

[Version] 15.0.28
[Issue Type] Bug

Change-Id: I55b3e001ff035ca1983b96efcea3c8e4728f513a
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/echo-cancel/processor.c
src/echo-cancel/processor.h

index 48aacf5..b8c2e8a 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          15.0.27
+Version:          15.0.28
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 8dc6c2d..6670955 100644 (file)
@@ -492,11 +492,14 @@ pa_processor_method_t pa_processor_get_method(const char *request_method) {
     else if (pa_streq(request_method, "reference_copy"))
         method = PA_PROCESSOR_REFERENCE_COPY;
     else
-        /* request_method could be had 'default' */
-        method = PA_PROCESSOR_METHOD_DEFAULT;
+#ifdef SUPPORT_METHOD_WEBRTC
+        method = PA_PROCESSOR_WEBRTC;
+#else
+        method = PA_PROCESSOR_SPEEX;
+#endif
 
-    pa_log_info("processing method is selected. request_method(%s), method_to_string(%s)",
-                request_method, pa_processor_method_to_string(method));
+    pa_log_info("processing method is selected. method(%d), request_method(%s), method_to_string(%s)",
+                method, request_method, pa_processor_method_to_string(method));
 
     return method;
 }
index 625bb25..3e81c22 100644 (file)
 #include <pulse/channelmap.h>
 #include <pulse/sample.h>
 
+/* These are used as an index to choose a method in method_table. Keep this order */
 typedef enum {
-    PA_PROCESSOR_ADRIAN,
-    PA_PROCESSOR_REFERENCE_COPY,
     PA_PROCESSOR_SPEEX,
+    PA_PROCESSOR_ADRIAN,
 #ifdef SUPPORT_METHOD_WEBRTC
     PA_PROCESSOR_WEBRTC,
-    PA_PROCESSOR_METHOD_DEFAULT = PA_PROCESSOR_WEBRTC,
-#else
-    PA_PROCESSOR_METHOD_DEFAULT = PA_PROCESSOR_SPEEX,
 #endif
+    PA_PROCESSOR_REFERENCE_COPY,
     PA_PROCESSOR_METHOD_MAX,
 } pa_processor_method_t;