summaryrefslogtreecommitdiff
path: root/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-vdr2.3.patch
blob: 88c0a095c950fff564049dcc039e67a57e51f532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--- a/devstatus.c
+++ b/devstatus.c
@@ -55,8 +55,14 @@
    int channelNo;
    cChannel *channel = NULL;
 
+#if VDRVERSNUM < 20300
    for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
       if( (channel = Channels.GetByNumber(channelNo)) ) {
+#else
+   LOCK_CHANNELS_READ;
+   for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
+      if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
+#endif
          if (d->IsTunedToTransponder(channel)) {
            return channel;
          }
@@ -78,8 +84,14 @@
    cChannel *resChannel = NULL;
    int oldQRG = getTunedFrequency(device);
             
+#if VDRVERSNUM < 20300
    for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
       if( (channel = Channels.GetByNumber(channelNo)) ) {
+#else
+   LOCK_CHANNELS_READ;
+   for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
+      if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
+#endif
           if( device->ProvidesSource( channel->Source() ) ) { // same source (DVB-T, -S, ...)
              if( !ISTRANSPONDER(channel->Frequency(),oldQRG) ) {  //not the same transponder
                if( channel->Frequency()*direction > oldQRG*direction ) {  
@@ -152,7 +164,11 @@
   int GetChannelNr()  { return ChannelNr; }
   bool IsChannel() { return ChannelNr != 0; }
   bool HasDevice() { return DeviceNr >= 0; }
+#if VDRVERSNUM < 20300
   cChannel* GetChannel()  { return Channels.GetByNumber(ChannelNr); }
+#else
+  cChannel* GetChannel()  { LOCK_CHANNELS_READ; return (cChannel*) Channels->GetByNumber(ChannelNr); }
+#endif
   cDevice* GetDevice() { return cDevice::GetDevice(DeviceNr); };
 };
 
@@ -279,8 +295,15 @@
                  int channelNo;
                  cChannel *channel = NULL;
        
+#if VDRVERSNUM < 20300
                  for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
                     if( (channel = Channels.GetByNumber(channelNo)) ) {
+#else
+                 LOCK_CHANNELS_READ;
+                 for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
+                    if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
+
+#endif
                        if (d->IsTunedToTransponder(channel)) {
                             bool currentLive = channelNo == d->CurrentChannel() 
                                                && (i == cDevice::ActualDevice()->CardIndex());
@@ -350,7 +373,12 @@
     eOSState Play(char* file) {
             // Play the selected recording 
             cRecording* recordingFound = NULL;
+#if VDRVERSNUM < 20300
             for(cRecording* recording = Recordings.First(); recording; recording = Recordings.Next(recording))
+#else
+            LOCK_RECORDINGS_READ;
+            for(cRecording* recording = (cRecording*) Recordings->First(); recording; recording = (cRecording*) Recordings->Next(recording))
+#endif
                 if (strstr(recording->Title(), file))
                     recordingFound = recording;
             if (!recordingFound)
@@ -405,7 +433,12 @@
                     ri = (cMenuRecItem*)Get(Current());
                     if (ri->Selectable()) {
                         if (ri->IsChannel()) {
+#if VDRVERSNUM < 20300
                             Channels.SwitchTo(ri->GetChannelNr());
+#else
+                            LOCK_CHANNELS_READ;
+                            Channels->SwitchTo(ri->GetChannelNr());
+#endif
                             Write(); //repaint; maybe 'Live' has changed
                             return osContinue;
                         } else
@@ -635,7 +668,12 @@
 #endif
     if (Name) {
         // insert new timers currently recording in TimersRecording
+#if VDRVERSNUM < 20300
         for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti))
+#else
+        LOCK_TIMERS_READ;
+        for (cTimer *ti = (cTimer*) Timers->First(); ti; ti = (cTimer*) Timers->Next(ti))
+#endif
             if (ti->Recording()) {
                 // check if this is a new entry
                 bool bFound = false;