From: Roman Moravcik Date: Fri, 8 Jan 2010 14:04:03 +0000 (+0100) Subject: Flashlight was unable to turn on again after closing camera application. X-Git-Tag: v0.4-1~41 X-Git-Url: http://vcs.maemo.org/git/?p=flashlight-appl;a=commitdiff_plain;h=6773e0985a028d0631ce30842f2cb28adf82c88b Flashlight was unable to turn on again after closing camera application. --- diff --git a/debian/changelog b/debian/changelog index f50dab4..c534259 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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. diff --git a/src/flashlight_lib.c b/src/flashlight_lib.c index b28d1a9..ffe5517 100644 --- a/src/flashlight_lib.c +++ b/src/flashlight_lib.c @@ -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; }