summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-03-07 11:36:59 +0000
committerphintuka <phintuka>2009-03-07 11:36:59 +0000
commit0d08ec3094077e2a5268959d80c188684637c4e3 (patch)
treea238706d3f1c02e8f85e04cdc40eebf68ad27ac4
parentc93bf7bd20daada4e3e86511e54d1162e7603caf (diff)
downloadxineliboutput-0d08ec3094077e2a5268959d80c188684637c4e3.tar.gz
xineliboutput-0d08ec3094077e2a5268959d80c188684637c4e3.tar.bz2
Simplified vdr_event_cb()
-rw-r--r--xine_input_vdr.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index 1cb015b2..522b29f2 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.243 2009-03-07 11:31:56 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.244 2009-03-07 11:36:59 phintuka Exp $
*
*/
@@ -3282,27 +3282,23 @@ static void vdr_event_cb (void *user_data, const xine_event_t *event)
vdr_input_plugin_t *this = (vdr_input_plugin_t *)user_data;
int i;
- for(i=0; i < sizeof(vdr_keymap)/sizeof(vdr_keymap[0]); i++) {
- if(event->type == vdr_keymap[i].event) {
- if(event->data && event->data_length == 4 &&
- !strncmp(event->data, "VDR", 4)) {
- /*LOGMSG("Input event created by self, ignoring");*/
- return;
+ for (i = 0; i < sizeof(vdr_keymap) / sizeof(vdr_keymap[0]); i++) {
+ if (event->type == vdr_keymap[i].event) {
+ if (event->data && event->data_length == 4 &&
+ !strncmp(event->data, "VDR", 4)) {
+ /*LOGMSG("Input event created by self, ignoring");*/
+ return;
}
LOGDBG("XINE_EVENT (input) %d --> %s",
- event->type, vdr_keymap[i].name);
-
- if(this->funcs.post_vdr_event) {
- /* remote mode: -> input_plugin -> connection -> VDR */
- char *msg=NULL;
- if (asprintf(&msg, "KEY %s\r\n", vdr_keymap[i].name) >= 0) {
- this->funcs.post_vdr_event(&this->iface, msg);
- free(msg);
- }
+ event->type, vdr_keymap[i].name);
+
+ if (this->fd_control >= 0) {
+ /* remote mode: -> input_plugin -> connection -> VDR */
+ printf_control(this, "KEY %s\r\n", vdr_keymap[i].name);
}
- if(this->funcs.xine_input_event) {
- /* local mode: -> VDR */
- this->funcs.xine_input_event(NULL, vdr_keymap[i].name);
+ if (this->funcs.xine_input_event) {
+ /* local mode: -> VDR */
+ this->funcs.xine_input_event(NULL, vdr_keymap[i].name);
}
return;
}