dvbOSDSkip does not work propertly when "the next channel" does not have a current_channel->num+1

View: New views
1 Messages — Rating Filter:   Alert me  

dvbOSDSkip does not work propertly when "the next channel" does not have a current_channel->num+1

by Leo Iannacone :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everyone,

my name is Leo Iannacone and I just started using kaffeine to see
satellite TV on my PC.

I immediately found a problem:

while displaying the OSD informations of a channel, I wanted to go to
the next channel informations, if the channel had not a
`current_channel->num= (+/-) 1` number, so I couldn't watch OSD infos of
the channel that I was looking for.

To better explain:
I'm watching channel num. 301.
Read OSD infos, skip to the next channel (302), and skip to the next too
(304).
The last channel (304) has not the `current_ch->num+1` (I don't have in
channels list a channel->num=303), so OSD is locked on the
current_channel (302) infos, unable to jump to channel 304.

I modified the function dvbOSDSkip file kaffeine/src/input/dvbpanel.cpp
just adding a simple `while`. Now the OSD is displayed properly.

The changes are very simple, see the attachment. I've tried it in
extreme cases (as jumping from channel 900 to channel 10090) and seems
to work fine.

Regards,
Leo.

--
GPG Key ID: 1024D/D59257A9
Key fingerprint: DC75 469F 4831 4293 81A4 423C 6884 31F6 D592 57A9
More info: http://wiki.ubuntu.com/LeoIannacone



--- kaffeine/src/input/dvb/dvbpanel.cpp 2008-11-19 14:26:25.000000000 +0100
+++ kaffeine/src/input/dvb/dvbpanel.new.cpp 2008-11-19 14:26:22.000000000 +0100
@@ -812,26 +812,32 @@
 
  int mychan = -1;
 
- if (browseDvbStream == -1)
- mychan = dvbConfig->lastChannel;
- else
- mychan = browseDvbStream + skip;
-
- if (mychan < minChannelNumber)
- mychan = maxChannelNumber;
- else if (mychan > maxChannelNumber)
- mychan = minChannelNumber;
+ while(!chan)
+ {
+ if (browseDvbStream == -1)
+ mychan = dvbConfig->lastChannel;
+ else
+ mychan = browseDvbStream + skip;
 
- for (int i = 0; i < (int)channels.count(); i ++) {
- if ((int) channels.at(i)->num == mychan) {
- chan = channels.at(i);
- break;
+ if (mychan < minChannelNumber)
+ mychan = maxChannelNumber;
+ else if (mychan > maxChannelNumber)
+ mychan = minChannelNumber;
+
+ for (int i = 0; i < (int)channels.count(); i ++) {
+ if ((int) channels.at(i)->num == mychan) {
+ chan = channels.at(i);
+ break;
+ }
  }
+
+ if(skip < 0)
+ skip --;
+ if (skip > 0)
+ skip ++;
+
  }
 
- if (!chan)
- return;
-
  for (int j = 0; j < (int)dvb.count(); j ++) {
  if (dvb.at(j)->canSource(chan)) {
  d = dvb.at(j);

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
kaffeine-devel mailing list
kaffeine-devel@...
https://lists.sourceforge.net/lists/listinfo/kaffeine-devel