Flashlight was unable to turn on again after closing camera application.
authorRoman Moravcik <roman.moravcik@gmail.com>
Fri, 8 Jan 2010 14:04:03 +0000 (15:04 +0100)
committerRoman Moravcik <roman.moravcik@gmail.com>
Fri, 8 Jan 2010 14:04:03 +0000 (15:04 +0100)
debian/changelog
src/flashlight_lib.c

index f50dab4..c534259 100644 (file)
@@ -1,3 +1,10 @@
+flashlight-applet (0.3-1) fremantle; urgency=low
+
+  * Flashlight was unable to turn on again after closing camera
+    application.
+
+ -- Roman Moravcik <roman.moravcik@gmail.com>  Fri,  8 Jan 2010 14:53:47 +0100
+
 flashlight-applet (0.3-0) fremantle; urgency=low
 
   * Fixed bug 4906: Instruction to start Flashlight Applet not clear.
index b28d1a9..ffe5517 100644 (file)
@@ -107,7 +107,6 @@ int flashlight_set_intensity (FlashlightContext_t *flashlight, int intensity)
 {
        struct v4l2_control ctrl;
        enum v4l2_buf_type type;
-       unsigned int i;
 
        printf ("flashlight_set_intensity(%d)\n", intensity);
 
@@ -136,18 +135,6 @@ int flashlight_set_intensity (FlashlightContext_t *flashlight, int intensity)
           WORKAROUND: start/stop i/o streaming to block camera application
         */
        if (intensity > 0) {
-               for (i = 0; i < flashlight->n_buffers; ++i) {
-                       struct v4l2_buffer buf;
-
-                       buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-                       buf.memory      = V4L2_MEMORY_MMAP;
-                       buf.index       = i;
-                       if (ioctl (flashlight->fd, VIDIOC_QBUF, &buf) == -1) {
-                               printf ("flashlight_set_intensity: unable to exchange a buffer %d with driver (%s)\n", i, strerror (errno));
-                               return EGENERROR;
-                       }
-               }
-
                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                if (ioctl (flashlight->fd, VIDIOC_STREAMON, &type)) {
                        printf ("flashlight_set_intensity: unable to start i/o streaming (%s)\n", strerror (errno));
@@ -418,7 +405,7 @@ int flashlight_deinit (FlashlightContext_t *flashlight)
                                return EGENERROR;
                }
 
-               if (flashlight_close(flashlight))
+               if (flashlight_close (flashlight))
                        return EGENERROR;
        }