Skip to content

Commit

Permalink
Update lirc_client.c to bring it up to date with the version in LIRC …
Browse files Browse the repository at this point in the history
…release 0.8.6. There are very few changes, primarily providing better handling of exceptional circumstances.

git-svn-id: http://svn.mythtv.org/svn/trunk@25415 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
sphery committed Jul 24, 2010
1 parent 44beec3 commit 21f80da
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions mythtv/libs/libmythui/lirc_client.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* NOTE: Extracted from LIRC release 0.8.4a -- dtk */
/* Updated to LIRC release 0.8.6 */

/****************************************************************************
** lirc_client.c ***********************************************************
Expand Down Expand Up @@ -1575,14 +1576,19 @@ static int lirc_iscode(struct lirc_config_entry *scan, char *remote,
if(scan->code->next==NULL || rep==0)
{
scan->next_code=scan->next_code->next;
if(scan->code->next != NULL)
{
iscode=1;
}
}
/* sequence completed? */
if(scan->next_code==NULL)
{
scan->next_code=scan->code;
iscode=scan->code->next!=NULL || rep==0 ||
if(scan->code->next!=NULL || rep==0 ||
(scan->rep>0 && rep>scan->rep_delay &&
((rep-scan->rep_delay-1)%scan->rep)==0);
((rep-scan->rep_delay-1)%scan->rep)==0))
iscode=2;
}
return iscode;
}
Expand Down Expand Up @@ -1720,6 +1726,7 @@ static int lirc_code2char_internal(const struct lirc_state *state,
char *remote,*button;
char *s=NULL;
struct lirc_config_entry *scan;
int exec_level;
int quit_happened;

*string=NULL;
Expand All @@ -1743,18 +1750,26 @@ static int lirc_code2char_internal(const struct lirc_state *state,
quit_happened=0;
while(scan!=NULL)
{
if(lirc_iscode(scan,remote,button,rep) &&
exec_level = lirc_iscode(scan,remote,button,rep);
if(exec_level > 0 &&
(scan->mode==NULL ||
(scan->mode!=NULL &&
config->current_mode!=NULL &&
strcasecmp(scan->mode,config->current_mode)==0)) &&
quit_happened==0
)
{
s=lirc_execute(state,config,scan);
if(s != NULL && prog != NULL)
if(exec_level > 1)
{
s=lirc_execute(state,config,scan);
if(s != NULL && prog != NULL)
{
*prog = scan->prog;
}
}
else
{
*prog = scan->prog;
s = NULL;
}
if(scan->flags&quit)
{
Expand Down

0 comments on commit 21f80da

Please sign in to comment.