Snap for 4667902 from 099260928a814f48f27b8ff532a6af782a67f34d to pi-release

Change-Id: I55a286aa2a0b9bf1b4b563583870cd1ae3549d77
diff --git a/tinycap.c b/tinycap.c
index cea98a1..b0c1908 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -200,6 +200,7 @@
     char *buffer;
     unsigned int size;
     unsigned int bytes_read = 0;
+    unsigned int frames = 0;
     struct timespec end;
     struct timespec now;
 
@@ -250,7 +251,8 @@
         }
     }
 
+    frames = pcm_bytes_to_frames(pcm, bytes_read);
     free(buffer);
     pcm_close(pcm);
-    return pcm_bytes_to_frames(pcm, bytes_read);
+    return frames;
 }