1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Zero the Rid when trying the incrementation of it at first

This commit is contained in:
Antti Seppälä 2007-10-01 15:30:22 +00:00
parent 588a86284d
commit e77045ac8a

11
setup.c
View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: setup.c,v 1.16 2007/09/30 21:38:31 rahrenbe Exp $ * $Id: setup.c,v 1.17 2007/10/01 15:30:22 ajhseppa Exp $
*/ */
#include <string.h> #include <string.h>
@ -205,6 +205,7 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
cChannel newchannel; cChannel newchannel;
SetChannelData(&newchannel); SetChannelData(&newchannel);
bool uniquityFailed = false; bool uniquityFailed = false;
bool firstIteration = true;
// Search for identical channels as these will be ignored by vdr // Search for identical channels as these will be ignored by vdr
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel; for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
iteratorChannel = Channels.Next(iteratorChannel)) { iteratorChannel = Channels.Next(iteratorChannel)) {
@ -226,7 +227,13 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
iteratorChannel->SetId(iteratorChannel->Nid(), iteratorChannel->SetId(iteratorChannel->Nid(),
iteratorChannel->Tid(), iteratorChannel->Tid(),
iteratorChannel->Sid(), iteratorChannel->Sid(),
iteratorChannel->Rid() + 1); firstIteration ?
0 : iteratorChannel->Rid() + 1);
// The first iteration prevents Rid:s from creeping slowly
// towards maximum value because they are always zeroed first
firstIteration = false;
// Re-set the search and start again // Re-set the search and start again
iteratorChannel = Channels.First(); iteratorChannel = Channels.First();
continue; continue;