Quote:
Maybe a line in both SaveAux and RestoreSrc to check "if the previous state and the future state are the same, do nothing" will do it?


That line is already there:Code:

static void
switch_to_src (int from_src, int to_src)
{
if (from_src != to_src) {
unsigned int button = 0;
switch (to_src) {
case INPUT_AUX:
if (from_src != INPUT_PCM) {
if (!kenwood_disabled) {
button = IR_KW_TAPE_PRESSED;
break;
}
hijack_enq_button_pair(IR_RIO_SOURCE_PRESSED);
}
// fall thru
case INPUT_PCM:
button = IR_RIO_SOURCE_PRESSED;
break;

case INPUT_RADIO_AM:
if (from_src != INPUT_RADIO_FM)
hijack_enq_button_pair(IR_RIO_TUNER_PRESSED);
// fall thru
case INPUT_RADIO_FM:
button = IR_RIO_TUNER_PRESSED;
break;
}
if (button)
hijack_enq_button_pair(button);
}
}