$ git clone http://tcclient.ion.nu/tc_client.git
commit a030d50820a649fe5fe0bf7a396118a61c89968a
Author: Alicia <...>
Date:   Thu Oct 20 14:00:09 2016 +0200

    libcamera(escapi): handle failure to open camera more gracefully.

diff --git a/ChangeLog b/ChangeLog
index 68b80f2..e6baf5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ tc_client-gtk: bugfix: don't rely on stack allocated variables for GUI callbacks
 tc_client-gtk: install the camera placeholder animation for the 'install' target.
 tc_client-gtk: mark outgoing video keyframes as keyframes.
 dist/appimage.sh: fix audio in appimages by building ffmpeg with support for nellymoser and speex, and depending on the system's libao and libpulse instead of including it in the appimage.
+libcamera(escapi): handle failure to open camera more gracefully.
 0.40:
 Moved the backward compatibility code for avcodec_{send,receive}_{frame,packet} into a separate source file to avoid pulling libavcodec into utilities that don't use it.
 Improved the RTMP acknowledgement code: counting the format 3 headers which were previously skipped, setting a more reasonable acknowledgement interval at startup and giving the server some margin before dropping outgoing video packets.
diff --git a/utilities/libcamera/camera_escapi.cpp b/utilities/libcamera/camera_escapi.cpp
index 9032aea..1f23a27 100644
--- a/utilities/libcamera/camera_escapi.cpp
+++ b/utilities/libcamera/camera_escapi.cpp
@@ -88,9 +88,13 @@ void cam_resolution_escapi(CAM* cam, unsigned int* width, unsigned int* height)
 
 void cam_getframe_escapi(CAM* cam, void* pixmap)
 {
+  unsigned int pixels=cam->capture.mWidth*cam->capture.mHeight;
+  if(!cam->capturing)
+  {
+    memset(pixmap, 0x7f, pixels*3);
+  }
   doCapture(cam->device);
   while(!isCaptureDone(cam->device)){usleep(100);}
-  unsigned int pixels=cam->capture.mWidth*cam->capture.mHeight;
   unsigned int i;
   for(i=0; i<pixels; ++i)
   {