Snap for 9480469 from a5afe506835ea6acd809320c55c578a6292f9d61 to udc-release

Change-Id: I117be7138f07431d152c0ec0df6f3c150f1d880a
diff --git a/pcm.c b/pcm.c
index e593971..6d7dc29 100644
--- a/pcm.c
+++ b/pcm.c
@@ -26,6 +26,7 @@
 ** DAMAGE.
 */
 
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -253,8 +254,8 @@
 struct pcm {
     int fd;
     unsigned int flags;
-    int running:1;
-    int prepared:1;
+    bool running:1;
+    bool prepared:1;
     int underruns;
     unsigned int buffer_size;
     unsigned long boundary;
@@ -550,12 +551,12 @@
                 return prepare_error;
             if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x))
                 return oops(pcm, errno, "cannot write initial data");
-            pcm->running = 1;
+            pcm->running = true;
             return 0;
         }
         if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x)) {
-            pcm->prepared = 0;
-            pcm->running = 0;
+            pcm->prepared = false;
+            pcm->running = false;
             if (errno == EPIPE) {
                 /* we failed to make our window -- try to restart if we are
                  * allowed to do so.  Otherwise, simply allow the EPIPE error to
@@ -590,8 +591,8 @@
             }
         }
         if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) {
-            pcm->prepared = 0;
-            pcm->running = 0;
+            pcm->prepared = false;
+            pcm->running = false;
             if (errno == EPIPE) {
                     /* we failed to make our window -- try to restart */
                 pcm->underruns++;
@@ -892,8 +893,8 @@
     if (pcm->snd_node)
         snd_utils_put_dev_node(pcm->snd_node);
 
-    pcm->prepared = 0;
-    pcm->running = 0;
+    pcm->prepared = false;
+    pcm->running = false;
     pcm->buffer_size = 0;
     pcm->fd = -1;
     free(pcm);
@@ -1082,7 +1083,7 @@
     if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_PREPARE) < 0)
         return oops(pcm, errno, "cannot prepare channel");
 
-    pcm->prepared = 1;
+    pcm->prepared = true;
     return 0;
 }
 
@@ -1098,7 +1099,7 @@
     if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_START) < 0)
         return oops(pcm, errno, "cannot start channel");
 
-    pcm->running = 1;
+    pcm->running = true;
     return 0;
 }
 
@@ -1107,8 +1108,8 @@
     if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_DROP) < 0)
         return oops(pcm, errno, "cannot stop channel");
 
-    pcm->prepared = 0;
-    pcm->running = 0;
+    pcm->prepared = false;
+    pcm->running = false;
     return 0;
 }
 
@@ -1314,8 +1315,8 @@
 
                 err = pcm_wait(pcm, time);
                 if (err < 0) {
-                    pcm->prepared = 0;
-                    pcm->running = 0;
+                    pcm->prepared = false;
+                    pcm->running = false;
                     oops(pcm, errno, "wait error: hw 0x%x app 0x%x avail 0x%x\n",
                         (unsigned int)pcm->mmap_status->hw_ptr,
                         (unsigned int)pcm->mmap_control->appl_ptr,