Klaus Schmidinger wrote:
My guess would be that there is no uninterrupted stream of "repeat" keypresses. As soon as a non-repeat keypress is received, a channel switch will take place.
The channel doesn't change. Just the displayed channel number counts up, then jumps back down.
Please put a line like
fprintf(stderr, "%04X\n", Key);
at the beginning of cDisplayChannel::ProcessKey()
I've added some more lines. Looks like the "makes sure a channel switch through the SVDRP CHAN command is displayed" part is causing the reset to the currently shown channel, whenever there's a kNone in the key sequence. This happens roughly once a second.
Here's a log, starting on channel 5:
cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(Channel+) case kUp/Dn: channel=6 channel=NewChannel: Channel=6 cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=7 cDisplayChannel::ProcessKey(None) timeout, kNone: Channel=6 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=7 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=8 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=9 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=10 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=11 cDisplayChannel::ProcessKey(None) timeout, kNone: Channel=6 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=7 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=8 cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=9 [...] cDisplayChannel::ProcessKey(Channel+|Repeat) case kUp/Dn: channel=8 cDisplayChannel::ProcessKey(None) timeout, kNone: Channel=6 cDisplayChannel::ProcessKey(Channel+|Release) channel=NewChannel: Channel=6 cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None) cDisplayChannel::ProcessKey(None)
Channel=6 is always set within the last if block of ProcessKey(), the first time from the final channel=NewChannel, because the repeat did not yet kick in. Later, the channel is set from cDevice::CurrentChannel() on each kNone call. I have ChannelInfoTime=5, TimeoutRequChInfo=1.
Cheers,
Udo