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
6 VERBOSE(VB_SIPARSER, LOC + "Forcing Guide Present");
9 + if (QString(query.value(0).toString()) == "guide_on_single_tid")
11 + if (query.value(1).toString() == "yes")
13 + PrivateTypes.GuideOnSingleTransport = true;
14 + VERBOSE(VB_SIPARSER, LOC + "Guide is on single transport");
17 + if (QString(query.value(0).toString()) == "extended_guide_tid")
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));
24 if (QString(query.value(0).toString()) == "guide_fixup")
26 PrivateTypes.EITFixUp = query.value(1).toInt();
30 /* Standard Now/Next Event Information Table(s) */
32 - /* Standard Future Event Information Table(s) */
33 ParseDVBEIT(pid, &head, buffer, size);
36 + /* Standard Future Event Information Table(s) */
37 + ParseDVBEIT(pid, &head, buffer, size);
40 + /* Extended Event Information Table */
41 + if (PrivateTypes.ForceExtendedGuidePresent)
42 + ParseDVBEIT(pid, &head, buffer, size);
46 VERBOSE(VB_SIPARSER, LOC +
47 @@ -1195,17 +1217,26 @@
49 int CurrentTransport = 0;
52 + PrivateTypes.ForceExtendedGuidePresent = false;
54 uint16_t network_id = buffer[0] << 8 | buffer[1];
55 // TODO: Handle Network Specifics here if they aren't set
57 - PrivateTypes.ForceGuidePresent = true;
58 - PrivateTypes.GuideTransportID = 229;
59 - PrivateTypes.GuideOnSingleTransport = true;
61 if (PrivateTypesLoaded == false)
62 LoadPrivateTypes(network_id);
64 + if (PrivateTypes.GuideOnSingleTransport)
65 + PrivateTypes.GuideTransportID = PrivateTypes.CurrentTransportID;
67 + if (PrivateTypes.CurrentTransportID == PrivateTypes.ExtendedGuideOnTransport)
69 + PrivateTypes.ForceExtendedGuidePresent = true;
71 + VERBOSE(VB_SIPARSER, LOC +
72 + QString("SDT: Extended guide present on this TID: %1")
73 + .arg(head->table_id_ext));
76 if (PrivateTypes.SDTMapping)
78 if (PrivateTypes.CurrentTransportID == head->table_id_ext)
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);
92 if (Table[SERVICES]->AddSection(head,0,0))
94 - if(head->table_id_ext == PrivateTypes.GuideTransportID)
99 @@ -1321,9 +1350,18 @@
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
107 + // TODO: Handle BEV extended guide
108 + if (PrivateTypes.ForceExtendedGuidePresent)
110 + Table[EVENTS]->AddPid(0x300,0x00,0x00,true); // Dish 9-day
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
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
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
139 /// This is the DB schema version expected by the running MythTV instance.
140 const QString currentDatabaseVersion = "1122";
142 +/// This is the DB schema minor version used by supplementary patches
143 +const QString currentDatabaseVersionMinor = "1";
145 static bool UpdateDBVersionNumber(const QString &newnumber);
146 +static bool UpdateDBVersionMinor( const QString &newminor);
147 static bool performActualUpdate(const QString updates[], QString version,
149 +static bool performMinorUpdate(const QString updates[], QString minor,
151 static bool InitializeDatabase(void);
152 static bool doUpgradeTVDatabaseSchema(void);
153 +static bool dbMinorUpdate(void);
155 /** \defgroup db_schema MythTV Database Schema
161 +static bool UpdateDBVersionMinor(const QString &newminor)
163 + // delete old schema version
164 + MSqlQuery query(MSqlQuery::InitCon());
166 + QString thequery = "DELETE FROM settings WHERE value='DBSchemaVerMinor';";
167 + query.prepare(thequery);
170 + if (query.lastError().type() != QSqlError::None)
173 + QString("DB Error (Deleting old DB minor version number): \n"
174 + "Query was: %1 \nError was: %2 \nnew version: %3")
176 + .arg(MythContext::DBErrorMessage(query.lastError()))
178 + VERBOSE(VB_IMPORTANT, msg);
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);
188 + if (query.lastError().type() != QSqlError::None)
191 + QString("DB Error (Setting new DB minor version number): \n"
192 + "Query was: %1 \nError was: %2 \nnew minor version: %3")
194 + .arg(MythContext::DBErrorMessage(query.lastError()))
196 + VERBOSE(VB_IMPORTANT, msg);
203 /** \fn performActualUpdate(const QString[], QString, QString&)
204 * \brief Runs a number of SQL commands, and updates the schema version.
210 +static bool performMinorUpdate(const QString updates[], QString minor,
213 + MSqlQuery query(MSqlQuery::InitCon());
215 + VERBOSE(VB_IMPORTANT, QString("Upgrading to schema minor ") + minor);
218 + QString thequery = updates[counter];
220 + while (thequery != "")
222 + query.prepare(thequery);
225 + if (query.lastError().type() != QSqlError::None)
228 + QString("DB Error (Performing database upgrade): \n"
229 + "Query was: %1 \nError was: %2 \nnew minor: %3")
231 + .arg(MythContext::DBErrorMessage(query.lastError()))
233 + VERBOSE(VB_IMPORTANT, msg);
238 + thequery = updates[counter];
241 + if (!UpdateDBVersionMinor(minor))
248 /** \fn UpgradeTVDatabaseSchema(void)
249 * \brief This is the function called from outside dbcheck.cpp to update the schema.
251 @@ -416,14 +503,18 @@
252 bool UpgradeTVDatabaseSchema(void)
254 QString dbver = gContext->GetSetting("DBSchemaVer");
255 + QString dbminor = gContext->GetSetting("DBSchemaVerMinor");
257 - VERBOSE(VB_IMPORTANT, QString("Current Schema Version: %1").arg(dbver));
258 + VERBOSE(VB_IMPORTANT, QString("Current Schema Version: %1.%2").arg(dbver)
261 - if (dbver == currentDatabaseVersion)
262 + if ((dbver == currentDatabaseVersion) &&
263 + (dbminor == currentDatabaseVersionMinor))
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));
272 MSqlQuery lockquery(MSqlQuery::InitCon());
276 bool ret = doUpgradeTVDatabaseSchema();
278 + // Database version minor updates
280 + ret = dbMinorUpdate();
283 VERBOSE(VB_IMPORTANT, "Database Schema upgrade complete, unlocking.");
285 @@ -1996,6 +2091,35 @@
289 +static bool dbMinorUpdate(void)
291 + QString dbminor = gContext->GetSetting("DBSchemaVerMinor");
292 + if (dbminor == currentDatabaseVersionMinor)
294 + if ((dbminor == "") || (dbminor == "0"))
296 + const QString updates[] = {
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');",
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');",
313 + if (!performMinorUpdate(updates, "1", dbminor))
320 bool InitializeDatabase(void)