Fix coverity issue(UNUSED_VALUE) 32/294432/2
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 19 Jun 2023 07:43:37 +0000 (16:43 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Mon, 19 Jun 2023 07:45:38 +0000 (16:45 +0900)
[Version] 15.0.43
[Issue Type] Coverity(1677535)

Change-Id: I9b8e6c67e9a2fc96da95b31b8e8c21a84d2a2d96
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/module-tizenaudio-sink.c
src/module-tizenaudio-source.c

index ba66270..25e4812 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          15.0.42
+Version:          15.0.43
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 187ebf1..46cb580 100644 (file)
@@ -422,7 +422,6 @@ static int process_render(struct userdata *u, pa_usec_t now) {
 
 static void thread_func(void *userdata) {
     struct userdata *u = userdata;
-    unsigned short revents = 0;
 
     pa_assert(u);
 
@@ -481,7 +480,10 @@ static void thread_func(void *userdata) {
 
         if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
             struct pollfd *pollfd;
+
             if (u->rtpoll_item) {
+                unsigned short revents = 0;
+
                 pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
                 revents = pollfd->revents;
                 if (revents & ~POLLOUT) {
@@ -491,9 +493,6 @@ static void thread_func(void *userdata) {
 
                     /* Need to reset revents because pa_rtpoll_run just returns without calling poll */
                     pollfd->revents = 0;
-                    revents = 0;
-                } else {
-                    //pa_log_debug("Poll wakeup.", revents);
                 }
             }
         }
index 618c803..cc596d3 100644 (file)
@@ -345,7 +345,6 @@ static int process_render(struct userdata *u, pa_usec_t now) {
 
 static void thread_func(void *userdata) {
     struct userdata *u = userdata;
-    unsigned short revents = 0;
 
     pa_assert(u);
     pa_log_debug("Thread starting up");
@@ -400,16 +399,16 @@ static void thread_func(void *userdata) {
 
         if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
             struct pollfd *pollfd;
+
             if (u->rtpoll_item) {
+                unsigned short revents = 0;
+
                 pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
                 revents = pollfd->revents;
                 if (revents & ~POLLIN) {
                     pa_log_debug("Poll error 0x%x occured, try recover.", revents);
                     pa_hal_interface_pcm_recover(u->hal_interface, u->pcm_handle, revents);
                     u->first = true;
-                    revents = 0;
-                } else {
-                    //pa_log_debug("Poll wakeup.", revents);
                 }
             }
         }