changeset 2277:5e54ffc4f46f

Apply lirc patch from bugzilla. (Bugzilla #62).
author Andrew O. Shadoura <bugzilla@tut.by>
date Tue, 01 Jan 2008 16:03:44 -0600
parents a7c0e58fa489
children 614f7b9838fb
files src/lirc/Makefile src/lirc/about.c src/lirc/lirc.c
diffstat 3 files changed, 28 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lirc/Makefile	Thu Dec 27 20:50:05 2007 +0100
+++ b/src/lirc/Makefile	Tue Jan 01 16:03:44 2008 -0600
@@ -1,7 +1,10 @@
 PLUGIN = lirc${PLUGIN_SUFFIX}
 
 SRCS = about.c \
-       lirc.c
+       lirc.c \
+       lirc_cfg.c \
+       callbacks.c \
+       interface.c
 
 include ../../buildsys.mk
 include ../../extra.mk
--- a/src/lirc/about.c	Thu Dec 27 20:50:05 2007 +0100
+++ b/src/lirc/about.c	Tue Jan 01 16:03:44 2008 -0600
@@ -96,8 +96,9 @@
 "from the XMMS LIRC plugin by:\n"
 "Carl van Schaik <carl@leg.uct.ac.za>\n"
 "Christoph Bartelmus <xmms@bartelmus.de>\n"
+"Andrew O. Shadoura <bugzilla@tut.by>\n"
 "You can get LIRC information at:\n"
-"http://fsinfo.cs.uni-sb.de/~columbus/lirc/index.html"));
+"http://lirc.org"));
 
 	label=gtk_label_new( logo_text->str );
         g_string_free( logo_text, TRUE );
--- a/src/lirc/lirc.c	Thu Dec 27 20:50:05 2007 +0100
+++ b/src/lirc/lirc.c	Tue Jan 01 16:03:44 2008 -0600
@@ -46,13 +46,15 @@
 
 #include "lirc.h"
 
+#include "common.h"
+
 const char *plugin_name="LIRC Plugin";
 
 GeneralPlugin lirc_plugin = {
     .description = "LIRC Plugin",
     .init = init,
     .about = about,
-    .configure = NULL,
+    .configure = configure,
     .cleanup = cleanup
 };
 
@@ -67,7 +69,7 @@
 
 gint input_tag;
 
-void init(void)
+void init_lirc(void)
 {
 	int flags;
 	
@@ -98,6 +100,19 @@
 	fflush(stdout);
 }
 
+void init(void)
+{
+	load_cfg();
+	init_lirc();
+}
+
+gboolean reconnect_lirc(gpointer data)
+{
+	fprintf(stderr,_("%s: trying to reconnect...\n"),plugin_name);
+	init();
+	return (lirc_fd==-1);
+}
+
 void lirc_input_callback(gpointer data,gint source,
 			 GdkInputCondition condition)
 {
@@ -304,7 +319,11 @@
 		/* something went badly wrong */
 		fprintf(stderr,_("%s: disconnected from LIRC\n"),plugin_name);
 		cleanup();
-		return;
+		if(b_enable_reconnect)
+		{
+			fprintf(stderr,_("%s: will try reconnect every %d seconds...\n"),plugin_name,reconnect_timeout);
+			g_timeout_add(1000*reconnect_timeout, reconnect_lirc, NULL);
+		}
 	}
 }