]> git.pld-linux.org Git - packages/mythtv.git/blob - myth_eit-bev-dn_r10247.diff
- obsolete
[packages/mythtv.git] / myth_eit-bev-dn_r10247.diff
1 Index: libs/libmythtv/siparser.cpp
2 ===================================================================
3 --- libs/libmythtv/siparser.cpp.orig    2006-01-21 08:09:02.000000000 -0800
4 +++ libs/libmythtv/siparser.cpp 2006-01-21 08:09:09.000000000 -0800
5 @@ -297,6 +297,21 @@
6                      VERBOSE(VB_SIPARSER, LOC + "Forcing Guide Present");
7                  }
8              }
9 +            if (QString(query.value(0).toString()) == "guide_on_single_tid")
10 +            {
11 +                if (query.value(1).toString() == "yes")
12 +                {
13 +                    PrivateTypes.GuideOnSingleTransport = true;
14 +                    VERBOSE(VB_SIPARSER, LOC + "Guide is on single transport");
15 +                }
16 +            }
17 +            if (QString(query.value(0).toString()) == "extended_guide_tid")
18 +            {
19 +                PrivateTypes.ExtendedGuideOnTransport = query.value(1).toInt();
20 +                VERBOSE(VB_SIPARSER, LOC +
21 +                        QString("Dish Network Extended Guide Present on Transport %1")
22 +                        .arg(PrivateTypes.ExtendedGuideOnTransport));
23 +            }
24              if (QString(query.value(0).toString()) == "guide_fixup")
25              {
26                  PrivateTypes.EITFixUp = query.value(1).toInt();
27 @@ -590,10 +605,17 @@
28  #ifdef USING_DVB_EIT
29          case 0x4E ... 0x4F:
30              /* Standard Now/Next Event Information Table(s) */
31 -        case 0x50 ... 0xFF:
32 -            /* Standard Future Event Information Table(s) */
33              ParseDVBEIT(pid, &head, buffer, size);
34              break;
35 +        case 0x50 ... 0x6F:
36 +            /* Standard Future Event Information Table(s) */
37 +            ParseDVBEIT(pid, &head, buffer, size); 
38 +            break;
39 +        case 0x70 ... 0xFF:
40 +            /* Extended Event Information Table */
41 +            if (PrivateTypes.ForceExtendedGuidePresent)
42 +                ParseDVBEIT(pid, &head, buffer, size);
43 +            break;
44  #endif
45          default:
46              VERBOSE(VB_SIPARSER, LOC + 
47 @@ -1195,17 +1217,26 @@
48  
49      int CurrentTransport = 0;
50  
51 -    bool get_epg=false;
52 +    PrivateTypes.ForceExtendedGuidePresent = false;
53 +
54      uint16_t network_id = buffer[0] << 8 | buffer[1];
55      // TODO: Handle Network Specifics here if they aren't set
56  
57 -    PrivateTypes.ForceGuidePresent = true;
58 -    PrivateTypes.GuideTransportID = 229;
59 -    PrivateTypes.GuideOnSingleTransport = true;
60 -
61      if (PrivateTypesLoaded == false)
62          LoadPrivateTypes(network_id);
63  
64 +    if (PrivateTypes.GuideOnSingleTransport)
65 +        PrivateTypes.GuideTransportID = PrivateTypes.CurrentTransportID;
66 +
67 +    if (PrivateTypes.CurrentTransportID == PrivateTypes.ExtendedGuideOnTransport)
68 +    {
69 +        PrivateTypes.ForceExtendedGuidePresent = true;
70 +
71 +        VERBOSE(VB_SIPARSER, LOC +
72 +            QString("SDT: Extended guide present on this TID: %1")
73 +            .arg(head->table_id_ext));
74 +    }
75 +
76      if (PrivateTypes.SDTMapping)
77      {
78          if (PrivateTypes.CurrentTransportID == head->table_id_ext)
79 @@ -1218,8 +1249,8 @@
80      }
81  
82      VERBOSE(VB_SIPARSER, LOC +
83 -            QString("SDT: This TID: %1 is %2the CurrentTransport")
84 -                  .arg(head->table_id_ext).arg(CurrentTransport ? "" : "not "));
85 +            QString("SDT: This TID: %1 (nid=%2) is %3the CurrentTransport")
86 +                  .arg(head->table_id_ext).arg(network_id).arg(CurrentTransport ? "" : "not "));
87      ProcessUnusedDescriptor(pid, (uint8_t *)head, sizeof(tablehead_t));
88      ProcessUnusedDescriptor(pid, (uint8_t *)buffer, size);
89  
90 @@ -1227,8 +1258,6 @@
91      {
92          if (Table[SERVICES]->AddSection(head,0,0))
93              return;
94 -        if(head->table_id_ext == PrivateTypes.GuideTransportID)
95 -            get_epg=true;
96      }
97      else
98      {
99 @@ -1321,9 +1350,18 @@
100  
101      // TODO: This is temp
102      Table[EVENTS]->DependencyMet(SERVICES);
103 -    //Table[EVENTS]->AddPid(0x12,0x00,0x00,true); // see ticket #755
104 -//    Table[EVENTS]->AddPid(0x12,0x7F,0x80,0x12); // see ticket #755
105 -    Table[EVENTS]->AddPid(0x300,0x00,0x00,true); // Dish 9-day
106 +
107 +    // TODO: Handle BEV extended guide
108 +    if (PrivateTypes.ForceExtendedGuidePresent)
109 +    {
110 +        Table[EVENTS]->AddPid(0x300,0x00,0x00,true); // Dish 9-day
111 +    }
112 +    else
113 +    {
114 +        // Handle everything else..
115 +        Table[EVENTS]->AddPid(0x12,0x00,0x00,true); // see ticket #755
116 +        Table[EVENTS]->AddPid(0x12,0x7F,0x80,0x12); // see ticket #755
117 +    }
118  }
119  
120  // CRC32 lookup table for polynomial 0x04c11db7
121 Index: libs/libmythtv/sitypes.h
122 ===================================================================
123 --- libs/libmythtv/sitypes.h.orig       2006-01-21 08:08:49.000000000 -0800
124 +++ libs/libmythtv/sitypes.h    2006-01-21 08:09:09.000000000 -0800
125 @@ -121,6 +121,8 @@
126      bool          CustomGuidePID;
127      uint16_t      GuidePID;
128      bool          GuideOnSingleTransport;
129 +    bool          ForceExtendedGuidePresent;
130 +    uint16_t      ExtendedGuideOnTransport;
131      uint16_t      GuideTransportID;
132      /* List of ServiceID:s for which to parse out subtitle from the description.
133         Used in EITFixUpStyle4() */
134 Index: libs/libmythtv/dbcheck.cpp
135 ===================================================================
136 --- libs/libmythtv/dbcheck.cpp.orig     2006-01-21 08:05:23.000000000 -0800
137 +++ libs/libmythtv/dbcheck.cpp  2006-01-21 08:09:09.000000000 -0800
138 @@ -12,11 +12,18 @@
139  /// This is the DB schema version expected by the running MythTV instance.
140  const QString currentDatabaseVersion = "1122";
141  
142 +/// This is the DB schema minor version used by supplementary patches
143 +const QString currentDatabaseVersionMinor = "1";
144 +
145  static bool UpdateDBVersionNumber(const QString &newnumber);
146 +static bool UpdateDBVersionMinor( const QString &newminor);
147  static bool performActualUpdate(const QString updates[], QString version,
148                                  QString &dbver);
149 +static bool performMinorUpdate(const QString updates[], QString minor,
150 +                                QString &dbminor);
151  static bool InitializeDatabase(void);
152  static bool doUpgradeTVDatabaseSchema(void);
153 +static bool dbMinorUpdate(void);
154  
155  /** \defgroup db_schema MythTV Database Schema
156  
157 @@ -353,6 +360,48 @@
158      return true;
159  }
160  
161 +static bool UpdateDBVersionMinor(const QString &newminor)
162 +{
163 +    // delete old schema version
164 +    MSqlQuery query(MSqlQuery::InitCon());
165 +
166 +    QString thequery = "DELETE FROM settings WHERE value='DBSchemaVerMinor';";
167 +    query.prepare(thequery);
168 +    query.exec();
169 +
170 +    if (query.lastError().type() != QSqlError::None)
171 +    {
172 +        QString msg =
173 +            QString("DB Error (Deleting old DB minor version number): \n"
174 +                    "Query was: %1 \nError was: %2 \nnew version: %3")
175 +            .arg(thequery)
176 +            .arg(MythContext::DBErrorMessage(query.lastError()))
177 +            .arg(newminor);
178 +        VERBOSE(VB_IMPORTANT, msg);
179 +        return false;
180 +    }
181 +
182 +    // set new schema minor
183 +    thequery = QString("INSERT INTO settings (value, data, hostname) "
184 +                       "VALUES ('DBSchemaVerMinor', %1, NULL);").arg(newminor);
185 +    query.prepare(thequery);
186 +    query.exec();
187 +
188 +    if (query.lastError().type() != QSqlError::None)
189 +    {
190 +        QString msg =
191 +            QString("DB Error (Setting new DB minor version number): \n"
192 +                    "Query was: %1 \nError was: %2 \nnew minor version: %3")
193 +            .arg(thequery)
194 +            .arg(MythContext::DBErrorMessage(query.lastError()))
195 +            .arg(newminor);
196 +        VERBOSE(VB_IMPORTANT, msg);
197 +        return false;
198 +    }
199 +
200 +    return true;
201 +}
202 +
203  /** \fn performActualUpdate(const QString[], QString, QString&)
204   *  \brief Runs a number of SQL commands, and updates the schema version.
205   *
206 @@ -400,6 +449,44 @@
207      return true;
208  }
209  
210 +static bool performMinorUpdate(const QString updates[], QString minor,
211 +                                QString &dbminor)
212 +{
213 +    MSqlQuery query(MSqlQuery::InitCon());
214 +
215 +    VERBOSE(VB_IMPORTANT, QString("Upgrading to schema minor ") + minor);
216 +
217 +    int counter = 0;
218 +    QString thequery = updates[counter];
219 +
220 +    while (thequery != "")
221 +    {
222 +        query.prepare(thequery);
223 +        query.exec();
224 +
225 +        if (query.lastError().type() != QSqlError::None)
226 +        {
227 +            QString msg =
228 +                QString("DB Error (Performing database upgrade): \n"
229 +                        "Query was: %1 \nError was: %2 \nnew minor: %3")
230 +                .arg(thequery)
231 +                .arg(MythContext::DBErrorMessage(query.lastError()))
232 +                .arg(minor);
233 +            VERBOSE(VB_IMPORTANT, msg);
234 +            return false;
235 +        }
236 +
237 +        counter++;
238 +        thequery = updates[counter];
239 +    }
240 +
241 +    if (!UpdateDBVersionMinor(minor))
242 +        return false;
243 +
244 +    dbminor = minor;
245 +    return true;
246 +}
247 +
248  /** \fn UpgradeTVDatabaseSchema(void)
249   *  \brief This is the function called from outside dbcheck.cpp to update the schema.
250   *
251 @@ -416,14 +503,18 @@
252  bool UpgradeTVDatabaseSchema(void)
253  {
254      QString dbver = gContext->GetSetting("DBSchemaVer");
255 +    QString dbminor = gContext->GetSetting("DBSchemaVerMinor");
256  
257 -    VERBOSE(VB_IMPORTANT, QString("Current Schema Version: %1").arg(dbver));
258 +    VERBOSE(VB_IMPORTANT, QString("Current Schema Version: %1.%2").arg(dbver)
259 +                                                                  .arg(dbminor));
260  
261 -    if (dbver == currentDatabaseVersion)
262 +    if ((dbver == currentDatabaseVersion) &&
263 +        (dbminor == currentDatabaseVersionMinor))
264          return true;
265  
266 -    VERBOSE(VB_IMPORTANT, QString("Newest Schema Version : %1")
267 -                                  .arg(currentDatabaseVersion));
268 +    VERBOSE(VB_IMPORTANT, QString("Newest Schema Version : %1.%2")
269 +                                  .arg(currentDatabaseVersion)
270 +                                  .arg(currentDatabaseVersionMinor));
271  
272      MSqlQuery lockquery(MSqlQuery::InitCon());
273  
274 @@ -455,6 +546,10 @@
275  
276      bool ret = doUpgradeTVDatabaseSchema();
277  
278 +    // Database version minor updates
279 +    if (ret)
280 +        ret = dbMinorUpdate();
281 +
282      if (ret)
283          VERBOSE(VB_IMPORTANT, "Database Schema upgrade complete, unlocking.");
284      else
285 @@ -1996,6 +2091,35 @@
286      return true;
287  }
288  
289 +static bool dbMinorUpdate(void)
290 +{
291 +    QString dbminor = gContext->GetSetting("DBSchemaVerMinor");
292 +    if (dbminor == currentDatabaseVersionMinor)
293 +        return true;
294 +    if ((dbminor == "") || (dbminor == "0"))
295 +    {
296 +        const QString updates[] = {
297 +// Dish Network
298 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
299 +" VALUES('dvb', 4102, 'force_guide_present', 'yes');",
300 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
301 +" VALUES('dvb', 4102, 'extended_guide_tid', '229');",
302 +// Bell ExpressVu
303 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
304 +" VALUES('dvb', 256, 'force_guide_present', 'yes');",
305 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
306 +" VALUES('dvb', 256, 'guide_on_single_tid', 'yes');",
307 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
308 +" VALUES('dvb', 257, 'force_guide_present', 'yes');",
309 +"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
310 +" VALUES('dvb', 257, 'guide_on_single_tid', 'yes');",
311 +""
312 +        };
313 +        if (!performMinorUpdate(updates, "1", dbminor))
314 +            return false;
315 +    }
316 +    return true;
317 +}
318  
319  
320  bool InitializeDatabase(void)
This page took 0.079955 seconds and 3 git commands to generate.