$ git clone http://tcclient.ion.nu/tc_client.git
commit 3d8e69f43389273bf01cd4c477b3ce8bca239a8e
Author: Alicia <...>
Date:   Sun Dec 11 17:12:03 2016 +0100

    dist/w32.sh: bundle Adwaita icons and gdk-pixbuf loaders.

diff --git a/ChangeLog b/ChangeLog
index cd993f8..c1656b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@ dist/appimage.sh: fix audio in appimages by building ffmpeg with support for nel
 libcamera(escapi): handle failure to open camera more gracefully.
 irchack: pass along "<user> cammed up" notifications.
 configure: skip looking for libraries used for the GUI applications when building on msys.
+dist/w32.sh: bundle Adwaita icons and gdk-pixbuf loaders.
 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/dist/w32.sh b/dist/w32.sh
index 6a97d7f..1edb378 100755
--- a/dist/w32.sh
+++ b/dist/w32.sh
@@ -22,9 +22,10 @@ finddeps()
   rm -f .handleddeps
 }
 
+make clean
 rm -rf escapi*
-# Find and download the latest version of ESCAPI
-curl -s 'http://sol.gfxile.net/zip/?C=M;O=D' | sed -n -e 's|.*<a [^>]*>\(escapi[^<]*\)<.*|http://sol.gfxile.net/zip/\1|p' | head -n 1 | xargs wget
+# Download ESCAPI, stick with version 2.1 because 3.0 seems unstable
+wget -c http://sol.gfxile.net/zip/escapi21.zip
 mkdir escapi
 (cd escapi; unzip ../escapi*.zip)
 version="`sed -n -e 's/^VERSION=//p' Makefile`"
@@ -49,11 +50,17 @@ cd "$here"
 ./configure
 make || exit 1
 
-cp *.exe gtkgui.glade "tc_client-${version}-w32/bin"
+cp *.exe gtkgui.glade camplaceholder.gif modicon.png "tc_client-${version}-w32/bin"
 (cd "tc_client-${version}-w32/bin"
 wget -c 'http://youtube-dl.org/downloads/latest/youtube-dl.exe')
 mkdir -p "tc_client-${version}-w32/share/glib-2.0/schemas"
+glib-compile-schemas /mingw32/share/glib-2.0/schemas
 cp /mingw32/share/glib-2.0/schemas/gschemas.compiled "tc_client-${version}-w32/share/glib-2.0/schemas"
+mkdir -p "tc_client-${version}-w32/share/icons/Adwaita"
+cp -r /mingw32/share/icons/Adwaita/16x16 /mingw32/share/icons/Adwaita/icon-theme.cache /mingw32/share/icons/Adwaita/index.theme "tc_client-${version}-w32/share/icons/Adwaita"
+mkdir -p "tc_client-${version}-w32/lib"
+gdk-pixbuf-query-loaders > /mingw32/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
+cp -r /mingw32/lib/gdk-pixbuf-2.0 "tc_client-${version}-w32/lib"
 . /etc/profile
 cd "$here"
 (
diff --git a/utilities/gtk/gui.c b/utilities/gtk/gui.c
index be8a157..e2b5256 100644
--- a/utilities/gtk/gui.c
+++ b/utilities/gtk/gui.c
@@ -1082,7 +1082,12 @@ void gui_init(char frombuild)
   }
   camplaceholder_iter=gdk_pixbuf_animation_get_iter(camplaceholder, 0);
   // Load moderator icon
-  modicon=gdk_pixbuf_new_from_file(PREFIX "/share/tc_client/modicon.png", 0);
+  if(frombuild)
+  {
+    modicon=gdk_pixbuf_new_from_file("modicon.png", 0);
+  }else{
+    modicon=gdk_pixbuf_new_from_file(PREFIX "/share/tc_client/modicon.png", 0);
+  }
   // Populate saved channels
   GtkWidget* startbox=GTK_WIDGET(gtk_builder_get_object(gui, "startbox"));
   int channelcount=config_get_int("channelcount");
diff --git a/utilities/gtk/media.c b/utilities/gtk/media.c
index 5f8bd12..353c5e8 100644
--- a/utilities/gtk/media.c
+++ b/utilities/gtk/media.c
@@ -380,7 +380,7 @@ void camselect_open(void(*cb)(CAM*), void(*ccb)(void))
 void camselect_change(GtkComboBox* combo, void* x)
 {
   if(!camselect.eventsource){return;} // Haven't opened the cam selection window yet (happens at startup)
-  if(camselect.current){cam_close(camselect.current);}
+  if(camselect.current){cam_close(camselect.current); camselect.current=0;}
   camselect.current=cam_open(gtk_combo_box_get_active_id(combo));
   if(!camselect.current){return;}
   camselect.size.width=320;
@@ -432,11 +432,7 @@ void camselect_file_preview(GtkFileChooser* dialog, gpointer data)
 const char* camselect_file(void)
 {
   GtkWidget* preview=gtk_image_new();
-#ifndef _WIN32
   GtkWindow* window=GTK_WINDOW(gtk_builder_get_object(gui, "camselection"));
-#else
-  GtkWindow* window=0;
-#endif
   GtkWidget* dialog=gtk_file_chooser_dialog_new("Open Image", window, GTK_FILE_CHOOSER_ACTION_OPEN, "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, (char*)0);
   GtkFileFilter* filter=gtk_file_filter_new();
   gtk_file_filter_add_pixbuf_formats(filter);
@@ -673,6 +669,7 @@ void camera_calcvolume(struct camera* cam, float* samples, unsigned int sampleco
 
 void volume_indicator(GdkPixbuf* frame, struct camera* cam)
 {
+  if(!frame){return;}
   if(cam->volumeold>10){return;} // Not sending any audio anymore
   guchar* pixels=gdk_pixbuf_get_pixels(frame);
   unsigned int channels=gdk_pixbuf_get_n_channels(frame);