1 | Check the return values of function calls. |
---|
2 | |
---|
3 | From: Erik Hovland <erik@hovland.org> |
---|
4 | |
---|
5 | |
---|
6 | --- |
---|
7 | |
---|
8 | mythtv/libs/libmythtv/channelbase.cpp | 4 |
---|
9 | mythtv/libs/libmythtv/channelgroup.cpp | 18 + |
---|
10 | mythtv/libs/libmythtv/channelgroupsettings.cpp | 9 |
---|
11 | mythtv/libs/libmythtv/channelutil.cpp | 38 +- |
---|
12 | mythtv/libs/libmythtv/dvbchannel.cpp | 4 |
---|
13 | mythtv/libs/libmythtv/iptv/iptvchannelfetcher.cpp | 26 + |
---|
14 | mythtv/libs/libmythtv/jobqueue.cpp | 3 |
---|
15 | mythtv/libs/libmythtv/previewgenerator.cpp | 12 - |
---|
16 | mythtv/libs/libmythtv/profilegroup.cpp | 10 - |
---|
17 | mythtv/libs/libmythtv/tv_play.cpp | 398 +++++++++++---------- |
---|
18 | mythtv/libs/libmythtv/tv_rec.cpp | 2 |
---|
19 | mythtv/libs/libmythtv/tvremoteutil.cpp | 25 + |
---|
20 | mythtv/libs/libmythtv/util-opengl.cpp | 39 +- |
---|
21 | mythtv/libs/libmythtv/videodisplayprofile.cpp | 9 |
---|
22 | mythtv/libs/libmythtv/videoout_opengl.cpp | 4 |
---|
23 | 15 files changed, 325 insertions(+), 276 deletions(-) |
---|
24 | |
---|
25 | |
---|
26 | diff --git a/mythtv/libs/libmythtv/channelbase.cpp b/mythtv/libs/libmythtv/channelbase.cpp |
---|
27 | index a884aa5..f527508 100644 |
---|
28 | --- a/mythtv/libs/libmythtv/channelbase.cpp |
---|
29 | +++ b/mythtv/libs/libmythtv/channelbase.cpp |
---|
30 | @@ -751,7 +751,9 @@ int ChannelBase::GetChanID() const |
---|
31 | if (query.size() <= 0) |
---|
32 | return -1; |
---|
33 | |
---|
34 | - query.next(); |
---|
35 | + if (!query.next()) |
---|
36 | + return -1; |
---|
37 | + |
---|
38 | return query.value(0).toInt(); |
---|
39 | } |
---|
40 | |
---|
41 | diff --git a/mythtv/libs/libmythtv/channelgroup.cpp b/mythtv/libs/libmythtv/channelgroup.cpp |
---|
42 | index a13dad8..2375176 100644 |
---|
43 | --- a/mythtv/libs/libmythtv/channelgroup.cpp |
---|
44 | +++ b/mythtv/libs/libmythtv/channelgroup.cpp |
---|
45 | @@ -48,7 +48,9 @@ bool ChannelGroup::ToggleChannel(uint chanid, int changrpid, int delete_chan) |
---|
46 | else if ((query.size() > 0) && delete_chan) |
---|
47 | { |
---|
48 | // We have a record...Remove it to toggle... |
---|
49 | - query.next(); |
---|
50 | + if (!query.next()) |
---|
51 | + return false; |
---|
52 | + |
---|
53 | QString id = query.value(0).toString(); |
---|
54 | query.prepare( |
---|
55 | QString("DELETE FROM channelgroup " |
---|
56 | @@ -124,7 +126,9 @@ bool ChannelGroup::DeleteChannel(uint chanid, int changrpid) |
---|
57 | else if (query.size() > 0) |
---|
58 | { |
---|
59 | // We have a record...Remove it to toggle... |
---|
60 | - query.next(); |
---|
61 | + if (!query.next()) |
---|
62 | + return false; |
---|
63 | + |
---|
64 | QString id = query.value(0).toString(); |
---|
65 | query.prepare( |
---|
66 | QString("DELETE FROM channelgroup " |
---|
67 | @@ -207,11 +211,11 @@ QString ChannelGroup::GetChannelGroupName(int grpid) |
---|
68 | MythDB::DBError("ChannelGroup::GetChannelGroups", query); |
---|
69 | else if (query.size() > 0) |
---|
70 | { |
---|
71 | - query.next(); |
---|
72 | - return query.value(0).toString(); |
---|
73 | + if (query.next()) |
---|
74 | + return query.value(0).toString(); |
---|
75 | } |
---|
76 | |
---|
77 | - return ""; |
---|
78 | + return QString(); |
---|
79 | } |
---|
80 | |
---|
81 | int ChannelGroup::GetChannelGroupId(QString changroupname) |
---|
82 | @@ -231,7 +235,9 @@ int ChannelGroup::GetChannelGroupId(QString changroupname) |
---|
83 | MythDB::DBError("ChannelGroup::GetChannelGroups", query); |
---|
84 | else if (query.size() > 0) |
---|
85 | { |
---|
86 | - query.next(); |
---|
87 | + if (!query.next()) |
---|
88 | + return -1; |
---|
89 | + |
---|
90 | return query.value(0).toUInt(); |
---|
91 | } |
---|
92 | |
---|
93 | diff --git a/mythtv/libs/libmythtv/channelgroupsettings.cpp b/mythtv/libs/libmythtv/channelgroupsettings.cpp |
---|
94 | index 2bfce78..db86a32 100644 |
---|
95 | --- a/mythtv/libs/libmythtv/channelgroupsettings.cpp |
---|
96 | +++ b/mythtv/libs/libmythtv/channelgroupsettings.cpp |
---|
97 | @@ -46,7 +46,9 @@ void ChannelGroupStorage::Load(void) |
---|
98 | MythDB::DBError("ChannelGroupStorage::Load", query); |
---|
99 | else |
---|
100 | { |
---|
101 | - query.next(); |
---|
102 | + if (!query.next()) |
---|
103 | + MythDB::DBError("ChannelGroupStorage::Load", query); |
---|
104 | + |
---|
105 | grpid = query.value(0).toUInt(); |
---|
106 | |
---|
107 | qstr = "SELECT * FROM channelgroup WHERE grpid = :GRPID AND chanid = :CHANID"; |
---|
108 | @@ -190,7 +192,10 @@ void ChannelGroupEditor::doDelete(void) |
---|
109 | query.bindValue(":NAME", name); |
---|
110 | if (!query.exec()) |
---|
111 | MythDB::DBError("ChannelGroupEditor::doDelete", query); |
---|
112 | - query.next(); |
---|
113 | + |
---|
114 | + if (!query.next()) |
---|
115 | + MythDB::DBError("ChannelGroupEditor::doDelete", query); |
---|
116 | + |
---|
117 | uint grpid = query.value(0).toUInt(); |
---|
118 | |
---|
119 | // Delete channels from this group |
---|
120 | diff --git a/mythtv/libs/libmythtv/channelutil.cpp b/mythtv/libs/libmythtv/channelutil.cpp |
---|
121 | index f7a9f8d..23a8135 100644 |
---|
122 | --- a/mythtv/libs/libmythtv/channelutil.cpp |
---|
123 | +++ b/mythtv/libs/libmythtv/channelutil.cpp |
---|
124 | @@ -619,9 +619,13 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, |
---|
125 | MythDB::DBError("Getting mplexid global search", query); |
---|
126 | else if (query.size()) |
---|
127 | { |
---|
128 | - query.next(); |
---|
129 | - q_networkid = query.value(0).toInt(); |
---|
130 | - q_transportid = query.value(1).toInt(); |
---|
131 | + if (!query.next()) |
---|
132 | + MythDB::DBError("Getting mplexid global search", query); |
---|
133 | + else |
---|
134 | + { |
---|
135 | + q_networkid = query.value(0).toInt(); |
---|
136 | + q_transportid = query.value(1).toInt(); |
---|
137 | + } |
---|
138 | } |
---|
139 | |
---|
140 | // Got a match, return it. |
---|
141 | @@ -683,13 +687,15 @@ int ChannelUtil::GetBetterMplexID(int current_mplexid, |
---|
142 | "GetBetterMplexID(): query#%1 qsize(%2) " |
---|
143 | "Returning %3") |
---|
144 | .arg(i).arg(query.size()).arg(current_mplexid)); |
---|
145 | - query.next(); |
---|
146 | - return query.value(0).toInt(); |
---|
147 | + if (query.next()); |
---|
148 | + return query.value(0).toInt(); |
---|
149 | } |
---|
150 | |
---|
151 | if (query.size() > 1) |
---|
152 | { |
---|
153 | - query.next(); |
---|
154 | + if (!query.next()) |
---|
155 | + return -1; |
---|
156 | + |
---|
157 | int ret = (i==0) ? current_mplexid : query.value(0).toInt(); |
---|
158 | VERBOSE(VB_CHANSCAN, QString( |
---|
159 | "GetBetterMplexID(): query#%1 qsize(%2) " |
---|
160 | @@ -742,7 +748,7 @@ bool ChannelUtil::GetTuningParams(uint mplexid, |
---|
161 | QString ChannelUtil::GetChannelStringField(int chan_id, const QString &field) |
---|
162 | { |
---|
163 | if (chan_id < 0) |
---|
164 | - return QString::null; |
---|
165 | + return QString(); |
---|
166 | |
---|
167 | MSqlQuery query(MSqlQuery::InitCon()); |
---|
168 | query.prepare(QString("SELECT %1 FROM channel " |
---|
169 | @@ -750,13 +756,15 @@ QString ChannelUtil::GetChannelStringField(int chan_id, const QString &field) |
---|
170 | if (!query.exec() || !query.isActive()) |
---|
171 | { |
---|
172 | MythDB::DBError("Selecting channel/dtv_multiplex 1", query); |
---|
173 | - return QString::null; |
---|
174 | + return QString(); |
---|
175 | } |
---|
176 | if (!query.size()) |
---|
177 | - return QString::null; |
---|
178 | + return QString(); |
---|
179 | |
---|
180 | - query.next(); |
---|
181 | - return query.value(0).toString(); |
---|
182 | + if (query.next()) |
---|
183 | + return query.value(0).toString(); |
---|
184 | + |
---|
185 | + return QString(); |
---|
186 | } |
---|
187 | |
---|
188 | QString ChannelUtil::GetChanNum(int chan_id) |
---|
189 | @@ -795,8 +803,8 @@ int ChannelUtil::GetSourceID(int db_mplexid) |
---|
190 | |
---|
191 | if (query.size() > 0) |
---|
192 | { |
---|
193 | - query.next(); |
---|
194 | - return query.value(0).toInt(); |
---|
195 | + if (query.next()) |
---|
196 | + return query.value(0).toInt(); |
---|
197 | } |
---|
198 | return -1; |
---|
199 | } |
---|
200 | @@ -1619,8 +1627,8 @@ int ChannelUtil::GetServiceVersion(int mplexid) |
---|
201 | |
---|
202 | if (query.size() > 0) |
---|
203 | { |
---|
204 | - query.next(); |
---|
205 | - return query.value(0).toInt(); |
---|
206 | + if (query.next()); |
---|
207 | + return query.value(0).toInt(); |
---|
208 | } |
---|
209 | return -1; |
---|
210 | } |
---|
211 | diff --git a/mythtv/libs/libmythtv/dvbchannel.cpp b/mythtv/libs/libmythtv/dvbchannel.cpp |
---|
212 | index eb1edd0..0c06fc5 100644 |
---|
213 | --- a/mythtv/libs/libmythtv/dvbchannel.cpp |
---|
214 | +++ b/mythtv/libs/libmythtv/dvbchannel.cpp |
---|
215 | @@ -1018,7 +1018,9 @@ int DVBChannel::GetChanID() const |
---|
216 | if (query.size() <= 0) |
---|
217 | return -1; |
---|
218 | |
---|
219 | - query.next(); |
---|
220 | + if (!query.next()) |
---|
221 | + return -1; |
---|
222 | + |
---|
223 | return query.value(0).toInt(); |
---|
224 | } |
---|
225 | |
---|
226 | diff --git a/mythtv/libs/libmythtv/iptv/iptvchannelfetcher.cpp b/mythtv/libs/libmythtv/iptv/iptvchannelfetcher.cpp |
---|
227 | index 064c9a3..d9c8efb 100644 |
---|
228 | --- a/mythtv/libs/libmythtv/iptv/iptvchannelfetcher.cpp |
---|
229 | +++ b/mythtv/libs/libmythtv/iptv/iptvchannelfetcher.cpp |
---|
230 | @@ -162,10 +162,15 @@ void IPTVChannelFetcher::RunScan(void) |
---|
231 | QObject::tr("Adding %1").arg(msg)); |
---|
232 | } |
---|
233 | chanid = ChannelUtil::CreateChanID(_sourceid, channum); |
---|
234 | - ChannelUtil::CreateChannel( |
---|
235 | - 0, _sourceid, chanid, name, name, channum, |
---|
236 | - 0, 0, 0, false, false, false, QString::null, |
---|
237 | - QString::null, "Default", xmltvid); |
---|
238 | + if (!ChannelUtil::CreateChannel(0, _sourceid, chanid, name, name, |
---|
239 | + channum, 0, 0, 0, false, false, |
---|
240 | + false, QString(), QString(), |
---|
241 | + "Default", xmltvid)) |
---|
242 | + { |
---|
243 | + VERBOSE(VB_IMPORTANT, |
---|
244 | + LOC_ERR + QString("Channel %1(%2) create failed") |
---|
245 | + .arg(name).arg(channum)); |
---|
246 | + } |
---|
247 | } |
---|
248 | else |
---|
249 | { |
---|
250 | @@ -174,10 +179,15 @@ void IPTVChannelFetcher::RunScan(void) |
---|
251 | _scan_monitor->ScanAppendTextToLog( |
---|
252 | QObject::tr("Updating %1").arg(msg)); |
---|
253 | } |
---|
254 | - ChannelUtil::UpdateChannel( |
---|
255 | - 0, _sourceid, chanid, name, name, channum, |
---|
256 | - 0, 0, 0, false, false, false, QString::null, |
---|
257 | - QString::null, "Default", xmltvid); |
---|
258 | + if (!ChannelUtil::UpdateChannel(0, _sourceid, chanid, name, name, |
---|
259 | + channum, 0, 0, 0, false, false, |
---|
260 | + false, QString(), QString(), |
---|
261 | + "Default", xmltvid)) |
---|
262 | + { |
---|
263 | + VERBOSE(VB_IMPORTANT, |
---|
264 | + LOC_ERR + QString("Channel %1(%2) update failed") |
---|
265 | + .arg(name).arg(channum)); |
---|
266 | + } |
---|
267 | } |
---|
268 | |
---|
269 | SetNumChannelsInserted(i); |
---|
270 | diff --git a/mythtv/libs/libmythtv/jobqueue.cpp b/mythtv/libs/libmythtv/jobqueue.cpp |
---|
271 | index c032088..d4183b5 100644 |
---|
272 | --- a/mythtv/libs/libmythtv/jobqueue.cpp |
---|
273 | +++ b/mythtv/libs/libmythtv/jobqueue.cpp |
---|
274 | @@ -2170,7 +2170,8 @@ void JobQueue::DoFlagCommercialsThread(int jobID) |
---|
275 | gContext->dispatch(me); |
---|
276 | |
---|
277 | program_info->pathname = program_info->GetPlaybackURL(); |
---|
278 | - (new PreviewGenerator(program_info, PreviewGenerator::kLocal))->Run(); |
---|
279 | + if (!(new PreviewGenerator(program_info, PreviewGenerator::kLocal))->Run()) |
---|
280 | + VERBOSE(VB_IMPORTANT, "PreviewGenerator::Run() failed"); |
---|
281 | } |
---|
282 | |
---|
283 | msg = tr("Commercial Flagging %1", "Job ID") |
---|
284 | diff --git a/mythtv/libs/libmythtv/previewgenerator.cpp b/mythtv/libs/libmythtv/previewgenerator.cpp |
---|
285 | index dc91a8b..9db6070 100644 |
---|
286 | --- a/mythtv/libs/libmythtv/previewgenerator.cpp |
---|
287 | +++ b/mythtv/libs/libmythtv/previewgenerator.cpp |
---|
288 | @@ -284,14 +284,20 @@ bool PreviewGenerator::Run(void) |
---|
289 | |
---|
290 | void *PreviewGenerator::PreviewRun(void *param) |
---|
291 | { |
---|
292 | + if (!param) |
---|
293 | + return NULL; |
---|
294 | + |
---|
295 | // Lower scheduling priority, to avoid problems with recordings. |
---|
296 | if (setpriority(PRIO_PROCESS, 0, 9)) |
---|
297 | VERBOSE(VB_IMPORTANT, LOC + "Setting priority failed." + ENO); |
---|
298 | - PreviewGenerator *gen = (PreviewGenerator*) param; |
---|
299 | + |
---|
300 | + PreviewGenerator *gen = static_cast<PreviewGenerator*>(param); |
---|
301 | gen->createSockets = true; |
---|
302 | - gen->Run(); |
---|
303 | + if (!gen->Run()) |
---|
304 | + VERBOSE(VB_IMPORTANT, LOC + "PreviewGenerator::Run() failed."); |
---|
305 | + |
---|
306 | gen->deleteLater(); |
---|
307 | - return NULL; |
---|
308 | + return param; |
---|
309 | } |
---|
310 | |
---|
311 | bool PreviewGenerator::RemotePreviewSetup(void) |
---|
312 | diff --git a/mythtv/libs/libmythtv/profilegroup.cpp b/mythtv/libs/libmythtv/profilegroup.cpp |
---|
313 | index ece7443..d21d2e5 100644 |
---|
314 | --- a/mythtv/libs/libmythtv/profilegroup.cpp |
---|
315 | +++ b/mythtv/libs/libmythtv/profilegroup.cpp |
---|
316 | @@ -118,11 +118,13 @@ QString ProfileGroup::getName(int group) |
---|
317 | |
---|
318 | if (result.exec() && result.isActive() && result.size() > 0) |
---|
319 | { |
---|
320 | - result.next(); |
---|
321 | + if (!result.next()) |
---|
322 | + return QString(); |
---|
323 | + |
---|
324 | return result.value(0).toString(); |
---|
325 | } |
---|
326 | |
---|
327 | - return NULL; |
---|
328 | + return QString(); |
---|
329 | } |
---|
330 | |
---|
331 | bool ProfileGroup::allowedGroupName(void) |
---|
332 | @@ -289,7 +291,9 @@ void ProfileGroupEditor::callDelete(void) |
---|
333 | |
---|
334 | if (result.exec() && result.isActive() && result.size() > 0) |
---|
335 | { |
---|
336 | - result.next(); |
---|
337 | + if (!result.next()) |
---|
338 | + return; |
---|
339 | + |
---|
340 | QString message = QObject::tr("Delete profile group:") + |
---|
341 | QString("\n'%1'?").arg(ProfileGroup::getName(id)); |
---|
342 | |
---|
343 | diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp |
---|
344 | index 444aaa7..7fe2a8b 100644 |
---|
345 | --- a/mythtv/libs/libmythtv/tv_play.cpp |
---|
346 | +++ b/mythtv/libs/libmythtv/tv_play.cpp |
---|
347 | @@ -1174,7 +1174,9 @@ void TV::AskAllowRecording(PlayerContext *ctx, |
---|
348 | |
---|
349 | ProgramInfo *info = new ProgramInfo; |
---|
350 | QStringList::const_iterator it = msg.begin(); |
---|
351 | - info->FromStringList(it, msg.end()); |
---|
352 | + if (!info->FromStringList(it, msg.end())) |
---|
353 | + VERBOSE(VB_IMPORTANT, LOC + "AskAllowRecording -- " + |
---|
354 | + QString("Could not initialize the ProgramInfo object")); |
---|
355 | |
---|
356 | QMutexLocker locker(&askAllowLock); |
---|
357 | QString key = info->MakeUniqueKey(); |
---|
358 | @@ -6000,18 +6002,20 @@ void TV::DoSkipCommercials(PlayerContext *ctx, int direction) |
---|
359 | ctx->UnlockDeleteNVP(__FILE__, __LINE__); |
---|
360 | |
---|
361 | struct StatusPosInfo posInfo; |
---|
362 | - ctx->CalcNVPSliderPosition(posInfo); |
---|
363 | - |
---|
364 | - bool slidertype = false; |
---|
365 | |
---|
366 | - OSD *osd = GetOSDLock(ctx); |
---|
367 | - if (osd) |
---|
368 | + if (ctx->CalcNVPSliderPosition(posInfo)) |
---|
369 | { |
---|
370 | - posInfo.desc = tr("Searching..."); |
---|
371 | - osd->ShowStatus(posInfo, slidertype, tr("Skip"), 6); |
---|
372 | - SetUpdateOSDPosition(true); |
---|
373 | - } |
---|
374 | - ReturnOSDLock(ctx, osd); |
---|
375 | + OSD *osd = GetOSDLock(ctx); |
---|
376 | + if (osd) |
---|
377 | + { |
---|
378 | + posInfo.desc = tr("Searching..."); |
---|
379 | + osd->ShowStatus(posInfo, false, tr("Skip"), 6); |
---|
380 | + SetUpdateOSDPosition(true); |
---|
381 | + } |
---|
382 | + ReturnOSDLock(ctx, osd); |
---|
383 | + } else |
---|
384 | + VERBOSE(VB_PLAYBACK, LOC + |
---|
385 | + "DoSkipCommercials: ctx->CalcNVPSliderPosition() failed"); |
---|
386 | |
---|
387 | ctx->LockDeleteNVP(__FILE__, __LINE__); |
---|
388 | if (ctx->nvp) |
---|
389 | @@ -6543,8 +6547,8 @@ bool TV::CommitQueuedInput(PlayerContext *ctx) |
---|
390 | if (ccInputMode) |
---|
391 | { |
---|
392 | commited = true; |
---|
393 | - if (HasQueuedInput()) |
---|
394 | - HandleTrackAction(ctx, "TOGGLECC"); |
---|
395 | + if (HasQueuedInput() && !HandleTrackAction(ctx, "TOGGLECC")) |
---|
396 | + VERBOSE(VB_IMPORTANT, "HandleTrackAction(TOGGLECC) failed"); |
---|
397 | } |
---|
398 | else if (asInputMode) |
---|
399 | { |
---|
400 | @@ -9610,218 +9614,218 @@ void TV::TreeMenuSelected(OSDListTreeItemSelectedEvent *e) |
---|
401 | |
---|
402 | PlayerContext *actx = GetPlayerReadLock(-1, __FILE__, __LINE__); |
---|
403 | |
---|
404 | - if (HandleTrackAction(actx, action)) |
---|
405 | - ; |
---|
406 | - else if (action == "TOGGLEMANUALZOOM") |
---|
407 | - SetManualZoom(actx, true, tr("Zoom Mode ON")); |
---|
408 | - else if (action == "TOGGLESTRETCH") |
---|
409 | - ToggleTimeStretch(actx); |
---|
410 | - else if (action.left(13) == "ADJUSTSTRETCH") |
---|
411 | + if (!HandleTrackAction(actx, action)) |
---|
412 | { |
---|
413 | - bool floatRead; |
---|
414 | - float stretch = action.right(action.length() - 13).toFloat(&floatRead); |
---|
415 | - if (floatRead && |
---|
416 | - stretch <= 2.0 && |
---|
417 | - stretch >= 0.48) |
---|
418 | + if (action == "TOGGLEMANUALZOOM") |
---|
419 | + SetManualZoom(actx, true, tr("Zoom Mode ON")); |
---|
420 | + else if (action == "TOGGLESTRETCH") |
---|
421 | + ToggleTimeStretch(actx); |
---|
422 | + else if (action.left(13) == "ADJUSTSTRETCH") |
---|
423 | { |
---|
424 | - actx->ts_normal = stretch; // alter speed before display |
---|
425 | - } |
---|
426 | + bool floatRead; |
---|
427 | + float stretch = action.right(action.length() - 13).toFloat(&floatRead); |
---|
428 | + if (floatRead && |
---|
429 | + stretch <= 2.0 && |
---|
430 | + stretch >= 0.48) |
---|
431 | + { |
---|
432 | + actx->ts_normal = stretch; // alter speed before display |
---|
433 | + } |
---|
434 | |
---|
435 | - StopFFRew(actx); |
---|
436 | + StopFFRew(actx); |
---|
437 | |
---|
438 | - if (actx->paused) |
---|
439 | - DoTogglePause(actx, true); |
---|
440 | + if (actx->paused) |
---|
441 | + DoTogglePause(actx, true); |
---|
442 | |
---|
443 | - ChangeTimeStretch(actx, 0, !floatRead); // just display |
---|
444 | - } |
---|
445 | - else if (action.left(11) == "SELECTSCAN_") |
---|
446 | - { |
---|
447 | - QString msg = QString::null; |
---|
448 | - actx->LockDeleteNVP(__FILE__, __LINE__); |
---|
449 | - actx->nvp->SetScanType((FrameScanType) action.right(1).toInt()); |
---|
450 | - actx->UnlockDeleteNVP(__FILE__, __LINE__); |
---|
451 | - msg = toString(actx->nvp->GetScanType()); |
---|
452 | + ChangeTimeStretch(actx, 0, !floatRead); // just display |
---|
453 | + } |
---|
454 | + else if (action.left(11) == "SELECTSCAN_") |
---|
455 | + { |
---|
456 | + QString msg = QString::null; |
---|
457 | + actx->LockDeleteNVP(__FILE__, __LINE__); |
---|
458 | + actx->nvp->SetScanType((FrameScanType) action.right(1).toInt()); |
---|
459 | + actx->UnlockDeleteNVP(__FILE__, __LINE__); |
---|
460 | + msg = toString(actx->nvp->GetScanType()); |
---|
461 | |
---|
462 | - if (!msg.isEmpty()) |
---|
463 | + if (!msg.isEmpty()) |
---|
464 | + { |
---|
465 | + OSD *osd = GetOSDLock(actx); |
---|
466 | + if (osd) |
---|
467 | + osd->SetSettingsText(msg, 3); |
---|
468 | + ReturnOSDLock(actx, osd); |
---|
469 | + } |
---|
470 | + } |
---|
471 | + else if (action.left(15) == "TOGGLEAUDIOSYNC") |
---|
472 | + ChangeAudioSync(actx, 0); |
---|
473 | + else if (action.left(11) == "TOGGLESLEEP") |
---|
474 | { |
---|
475 | - OSD *osd = GetOSDLock(actx); |
---|
476 | - if (osd) |
---|
477 | - osd->SetSettingsText(msg, 3); |
---|
478 | - ReturnOSDLock(actx, osd); |
---|
479 | + ToggleSleepTimer(actx, action.left(13)); |
---|
480 | } |
---|
481 | - } |
---|
482 | - else if (action.left(15) == "TOGGLEAUDIOSYNC") |
---|
483 | - ChangeAudioSync(actx, 0); |
---|
484 | - else if (action.left(11) == "TOGGLESLEEP") |
---|
485 | - { |
---|
486 | - ToggleSleepTimer(actx, action.left(13)); |
---|
487 | - } |
---|
488 | - else if (action.left(17) == "TOGGLEPICCONTROLS") |
---|
489 | - { |
---|
490 | - adjustingPictureAttribute = (PictureAttribute) |
---|
491 | - (action.right(1).toInt() - 1); |
---|
492 | - DoTogglePictureAttribute(actx, kAdjustingPicture_Playback); |
---|
493 | - } |
---|
494 | - else if (action.left(12) == "TOGGLEASPECT") |
---|
495 | - { |
---|
496 | - ToggleAspectOverride(actx, |
---|
497 | - (AspectOverrideMode) action.right(1).toInt()); |
---|
498 | - } |
---|
499 | - else if (action.left(10) == "TOGGLEFILL") |
---|
500 | - { |
---|
501 | + else if (action.left(17) == "TOGGLEPICCONTROLS") |
---|
502 | + { |
---|
503 | + adjustingPictureAttribute = (PictureAttribute) |
---|
504 | + (action.right(1).toInt() - 1); |
---|
505 | + DoTogglePictureAttribute(actx, kAdjustingPicture_Playback); |
---|
506 | + } |
---|
507 | + else if (action.left(12) == "TOGGLEASPECT") |
---|
508 | + { |
---|
509 | + ToggleAspectOverride(actx, |
---|
510 | + (AspectOverrideMode) action.right(1).toInt()); |
---|
511 | + } |
---|
512 | + else if (action.left(10) == "TOGGLEFILL") |
---|
513 | + { |
---|
514 | ToggleAdjustFill(actx, (AdjustFillMode) action.right(1).toInt()); |
---|
515 | - } |
---|
516 | - else if (action == "AUTODETECT_FILL") |
---|
517 | - { |
---|
518 | - actx->nvp->detect_letter_box->SetDetectLetterbox(!actx->nvp->detect_letter_box->GetDetectLetterbox()); |
---|
519 | - } |
---|
520 | - else if (action == "GUIDE") |
---|
521 | - EditSchedule(actx, kScheduleProgramGuide); |
---|
522 | - else if (action.left(10) == "CHANGROUP_") |
---|
523 | - { |
---|
524 | - if (action == "CHANGROUP_ALL_CHANNELS") |
---|
525 | - channel_group_id = -1; |
---|
526 | - else |
---|
527 | + } |
---|
528 | + else if (action == "AUTODETECT_FILL") |
---|
529 | { |
---|
530 | - action.remove("CHANGROUP_"); |
---|
531 | - |
---|
532 | - channel_group_id = action.toInt(); |
---|
533 | - |
---|
534 | - if (browse_changrp) |
---|
535 | + actx->nvp->detect_letter_box->SetDetectLetterbox(!actx->nvp->detect_letter_box->GetDetectLetterbox()); |
---|
536 | + } |
---|
537 | + else if (action == "GUIDE") |
---|
538 | + EditSchedule(actx, kScheduleProgramGuide); |
---|
539 | + else if (action.left(10) == "CHANGROUP_") |
---|
540 | + { |
---|
541 | + if (action == "CHANGROUP_ALL_CHANNELS") |
---|
542 | + channel_group_id = -1; |
---|
543 | + else |
---|
544 | { |
---|
545 | - m_channellist = ChannelUtil::GetChannels(0, true, "channum, callsign", channel_group_id); |
---|
546 | - ChannelUtil::SortChannels(m_channellist, "channum", true); |
---|
547 | + action.remove("CHANGROUP_"); |
---|
548 | |
---|
549 | - // make sure the current channel is from the selected group |
---|
550 | - // or tune to the first in the group |
---|
551 | - if (actx->tvchain) |
---|
552 | + channel_group_id = action.toInt(); |
---|
553 | + |
---|
554 | + if (browse_changrp) |
---|
555 | { |
---|
556 | - QString cur_channum = actx->tvchain->GetChannelName(-1); |
---|
557 | - QString new_channum = cur_channum; |
---|
558 | + m_channellist = ChannelUtil::GetChannels(0, true, "channum, callsign", channel_group_id); |
---|
559 | + ChannelUtil::SortChannels(m_channellist, "channum", true); |
---|
560 | |
---|
561 | - DBChanList::const_iterator it = m_channellist.begin(); |
---|
562 | - for (; it != m_channellist.end(); ++it) |
---|
563 | + // make sure the current channel is from the selected group |
---|
564 | + // or tune to the first in the group |
---|
565 | + if (actx->tvchain) |
---|
566 | { |
---|
567 | - if ((*it).channum == cur_channum) |
---|
568 | + QString cur_channum = actx->tvchain->GetChannelName(-1); |
---|
569 | + QString new_channum = cur_channum; |
---|
570 | + |
---|
571 | + DBChanList::const_iterator it = m_channellist.begin(); |
---|
572 | + for (; it != m_channellist.end(); ++it) |
---|
573 | { |
---|
574 | - break; |
---|
575 | + if ((*it).channum == cur_channum) |
---|
576 | + { |
---|
577 | + break; |
---|
578 | + } |
---|
579 | } |
---|
580 | - } |
---|
581 | |
---|
582 | - if (it == m_channellist.end()) |
---|
583 | - { |
---|
584 | - // current channel not found so switch to the |
---|
585 | - // first channel in the group |
---|
586 | - it = m_channellist.begin(); |
---|
587 | - if (it != m_channellist.end()) |
---|
588 | - new_channum = (*it).channum; |
---|
589 | - } |
---|
590 | + if (it == m_channellist.end()) |
---|
591 | + { |
---|
592 | + // current channel not found so switch to the |
---|
593 | + // first channel in the group |
---|
594 | + it = m_channellist.begin(); |
---|
595 | + if (it != m_channellist.end()) |
---|
596 | + new_channum = (*it).channum; |
---|
597 | + } |
---|
598 | |
---|
599 | - VERBOSE(VB_IMPORTANT, LOC + QString("Channel Group: '%1'->'%2'") |
---|
600 | - .arg(cur_channum).arg(new_channum)); |
---|
601 | + VERBOSE(VB_IMPORTANT, LOC + QString("Channel Group: '%1'->'%2'") |
---|
602 | + .arg(cur_channum).arg(new_channum)); |
---|
603 | |
---|
604 | - // Only change channel if new channel != current channel |
---|
605 | - if (cur_channum != new_channum && !new_channum.isEmpty()) |
---|
606 | - { |
---|
607 | - QMutexLocker locker(&timerIdLock); |
---|
608 | - queuedInput = new_channum; queuedInput.detach(); |
---|
609 | - queuedChanNum = new_channum; queuedChanNum.detach(); |
---|
610 | - queuedChanID = 0; |
---|
611 | - if (!queueInputTimerId) |
---|
612 | - queueInputTimerId = StartTimer(10, __LINE__); |
---|
613 | - } |
---|
614 | + // Only change channel if new channel != current channel |
---|
615 | + if (cur_channum != new_channum && !new_channum.isEmpty()) |
---|
616 | + { |
---|
617 | + QMutexLocker locker(&timerIdLock); |
---|
618 | + queuedInput = new_channum; queuedInput.detach(); |
---|
619 | + queuedChanNum = new_channum; queuedChanNum.detach(); |
---|
620 | + queuedChanID = 0; |
---|
621 | + if (!queueInputTimerId) |
---|
622 | + queueInputTimerId = StartTimer(10, __LINE__); |
---|
623 | + } |
---|
624 | |
---|
625 | - // Turn off OSD Channel Num so the channel changes right away |
---|
626 | - OSD *osd = GetOSDLock(actx); |
---|
627 | - if (osd) |
---|
628 | - osd->HideSet("channel_number"); |
---|
629 | - ReturnOSDLock(actx, osd); |
---|
630 | + // Turn off OSD Channel Num so the channel changes right away |
---|
631 | + OSD *osd = GetOSDLock(actx); |
---|
632 | + if (osd) |
---|
633 | + osd->HideSet("channel_number"); |
---|
634 | + ReturnOSDLock(actx, osd); |
---|
635 | + } |
---|
636 | } |
---|
637 | } |
---|
638 | } |
---|
639 | - } |
---|
640 | - else if (action == "FINDER") |
---|
641 | - EditSchedule(actx, kScheduleProgramFinder); |
---|
642 | - else if (action == "SCHEDULE") |
---|
643 | - EditSchedule(actx, kScheduledRecording); |
---|
644 | - else if (action == "VIEWSCHEDULED") |
---|
645 | - EditSchedule(actx, kViewSchedule); |
---|
646 | - else if (HandleJumpToProgramAction(actx, QStringList(action))) |
---|
647 | - { |
---|
648 | - } |
---|
649 | - else if (PxPHandleAction(actx, QStringList(action))) |
---|
650 | - { |
---|
651 | - // Hide the tree on old active context.. |
---|
652 | - for (uint i = 0; i < player.size(); i++) |
---|
653 | - { |
---|
654 | - OSD *osd = GetOSDLock(GetPlayer(actx,i)); |
---|
655 | - if (osd) |
---|
656 | - osd->HideTreeMenu(true); |
---|
657 | - ReturnOSDLock(GetPlayer(actx,i), osd); |
---|
658 | - ClearOSD(GetPlayer(actx,i)); |
---|
659 | - } |
---|
660 | - actx = GetPlayer(actx,-1); // "NEXTPIPWINDOW" changes active context.. |
---|
661 | - } |
---|
662 | - else if (StateIsLiveTV(GetState(actx))) |
---|
663 | - { |
---|
664 | - if (action == "TOGGLEBROWSE") |
---|
665 | - BrowseStart(actx); |
---|
666 | - else if (action == "PREVCHAN") |
---|
667 | - PopPreviousChannel(actx, true); |
---|
668 | - else if (action.left(14) == "SWITCHTOINPUT_") |
---|
669 | - { |
---|
670 | - switchToInputId = action.mid(14).toUInt(); |
---|
671 | - QMutexLocker locker(&timerIdLock); |
---|
672 | - if (!switchToInputTimerId) |
---|
673 | - switchToInputTimerId = StartTimer(1, __LINE__); |
---|
674 | - } |
---|
675 | - else if (action == "EDIT") |
---|
676 | - StartChannelEditMode(actx); |
---|
677 | - else |
---|
678 | - { |
---|
679 | - VERBOSE(VB_IMPORTANT, LOC_ERR + |
---|
680 | - "Unknown menu action selected: " + action); |
---|
681 | - hidetree = false; |
---|
682 | + else if (action == "FINDER") |
---|
683 | + EditSchedule(actx, kScheduleProgramFinder); |
---|
684 | + else if (action == "SCHEDULE") |
---|
685 | + EditSchedule(actx, kScheduledRecording); |
---|
686 | + else if (action == "VIEWSCHEDULED") |
---|
687 | + EditSchedule(actx, kViewSchedule); |
---|
688 | + else if (!HandleJumpToProgramAction(actx, QStringList(action))) |
---|
689 | + VERBOSE(VB_IMPORTANT, "HandleJumpToProgramAction failed"); |
---|
690 | + else if (PxPHandleAction(actx, QStringList(action))) |
---|
691 | + { |
---|
692 | + // Hide the tree on old active context.. |
---|
693 | + for (uint i = 0; i < player.size(); i++) |
---|
694 | + { |
---|
695 | + OSD *osd = GetOSDLock(GetPlayer(actx,i)); |
---|
696 | + if (osd) |
---|
697 | + osd->HideTreeMenu(true); |
---|
698 | + ReturnOSDLock(GetPlayer(actx,i), osd); |
---|
699 | + ClearOSD(GetPlayer(actx,i)); |
---|
700 | + } |
---|
701 | + actx = GetPlayer(actx,-1); // "NEXTPIPWINDOW" changes active context.. |
---|
702 | } |
---|
703 | - } |
---|
704 | - else if (StateIsPlaying(actx->GetState())) |
---|
705 | - { |
---|
706 | - if (action == "JUMPTODVDROOTMENU" || |
---|
707 | - action == "JUMPTODVDCHAPTERMENU" || |
---|
708 | - action == "JUMPTODVDTITLEMENU") |
---|
709 | + else if (StateIsLiveTV(GetState(actx))) |
---|
710 | { |
---|
711 | - QString menu = "root"; |
---|
712 | - if (action == "JUMPTODVDCHAPTERMENU") |
---|
713 | - menu = "chapter"; |
---|
714 | - else if (action == "JUMPTODVDTITLEMENU") |
---|
715 | - menu = "title"; |
---|
716 | - actx->LockDeleteNVP(__FILE__, __LINE__); |
---|
717 | - if (actx->nvp) |
---|
718 | - actx->nvp->GoToDVDMenu(menu); |
---|
719 | - actx->UnlockDeleteNVP(__FILE__, __LINE__); |
---|
720 | + if (action == "TOGGLEBROWSE") |
---|
721 | + BrowseStart(actx); |
---|
722 | + else if (action == "PREVCHAN") |
---|
723 | + PopPreviousChannel(actx, true); |
---|
724 | + else if (action.left(14) == "SWITCHTOINPUT_") |
---|
725 | + { |
---|
726 | + switchToInputId = action.mid(14).toUInt(); |
---|
727 | + QMutexLocker locker(&timerIdLock); |
---|
728 | + if (!switchToInputTimerId) |
---|
729 | + switchToInputTimerId = StartTimer(1, __LINE__); |
---|
730 | + } |
---|
731 | + else if (action == "EDIT") |
---|
732 | + StartChannelEditMode(actx); |
---|
733 | + else |
---|
734 | + { |
---|
735 | + VERBOSE(VB_IMPORTANT, LOC_ERR + |
---|
736 | + "Unknown menu action selected: " + action); |
---|
737 | + hidetree = false; |
---|
738 | + } |
---|
739 | } |
---|
740 | - else if (action == "EDIT") |
---|
741 | - StartProgramEditMode(actx); |
---|
742 | - else if (action == "TOGGLEAUTOEXPIRE") |
---|
743 | - ToggleAutoExpire(actx); |
---|
744 | - else if (action.left(14) == "TOGGLECOMMSKIP") |
---|
745 | - SetAutoCommercialSkip( |
---|
746 | - actx, (CommSkipMode)(action.right(1).toInt())); |
---|
747 | - else if (action == "QUEUETRANSCODE") |
---|
748 | - DoQueueTranscode(actx, "Default"); |
---|
749 | - else if (action == "QUEUETRANSCODE_AUTO") |
---|
750 | - DoQueueTranscode(actx, "Autodetect"); |
---|
751 | - else if (action == "QUEUETRANSCODE_HIGH") |
---|
752 | - DoQueueTranscode(actx, "High Quality"); |
---|
753 | - else if (action == "QUEUETRANSCODE_MEDIUM") |
---|
754 | - DoQueueTranscode(actx, "Medium Quality"); |
---|
755 | - else if (action == "QUEUETRANSCODE_LOW") |
---|
756 | - DoQueueTranscode(actx, "Low Quality"); |
---|
757 | - else |
---|
758 | + else if (StateIsPlaying(actx->GetState())) |
---|
759 | { |
---|
760 | - VERBOSE(VB_IMPORTANT, LOC_ERR + |
---|
761 | - "Unknown menu action selected: " + action); |
---|
762 | - hidetree = false; |
---|
763 | + if (action == "JUMPTODVDROOTMENU" || |
---|
764 | + action == "JUMPTODVDCHAPTERMENU" || |
---|
765 | + action == "JUMPTODVDTITLEMENU") |
---|
766 | + { |
---|
767 | + QString menu = "root"; |
---|
768 | + if (action == "JUMPTODVDCHAPTERMENU") |
---|
769 | + menu = "chapter"; |
---|
770 | + else if (action == "JUMPTODVDTITLEMENU") |
---|
771 | + menu = "title"; |
---|
772 | + actx->LockDeleteNVP(__FILE__, __LINE__); |
---|
773 | + if (actx->nvp) |
---|
774 | + actx->nvp->GoToDVDMenu(menu); |
---|
775 | + actx->UnlockDeleteNVP(__FILE__, __LINE__); |
---|
776 | + } |
---|
777 | + else if (action == "EDIT") |
---|
778 | + StartProgramEditMode(actx); |
---|
779 | + else if (action == "TOGGLEAUTOEXPIRE") |
---|
780 | + ToggleAutoExpire(actx); |
---|
781 | + else if (action.left(14) == "TOGGLECOMMSKIP") |
---|
782 | + SetAutoCommercialSkip( |
---|
783 | + actx, (CommSkipMode)(action.right(1).toInt())); |
---|
784 | + else if (action == "QUEUETRANSCODE") |
---|
785 | + DoQueueTranscode(actx, "Default"); |
---|
786 | + else if (action == "QUEUETRANSCODE_AUTO") |
---|
787 | + DoQueueTranscode(actx, "Autodetect"); |
---|
788 | + else if (action == "QUEUETRANSCODE_HIGH") |
---|
789 | + DoQueueTranscode(actx, "High Quality"); |
---|
790 | + else if (action == "QUEUETRANSCODE_MEDIUM") |
---|
791 | + DoQueueTranscode(actx, "Medium Quality"); |
---|
792 | + else if (action == "QUEUETRANSCODE_LOW") |
---|
793 | + DoQueueTranscode(actx, "Low Quality"); |
---|
794 | + else |
---|
795 | + { |
---|
796 | + VERBOSE(VB_IMPORTANT, LOC_ERR + |
---|
797 | + "Unknown menu action selected: " + action); |
---|
798 | + hidetree = false; |
---|
799 | + } |
---|
800 | } |
---|
801 | } |
---|
802 | |
---|
803 | diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp |
---|
804 | index 08c3308..2c4b6f8 100644 |
---|
805 | --- a/mythtv/libs/libmythtv/tv_rec.cpp |
---|
806 | +++ b/mythtv/libs/libmythtv/tv_rec.cpp |
---|
807 | @@ -3759,7 +3759,7 @@ void TVRec::TuningFrequency(const TuningRequest &request) |
---|
808 | |
---|
809 | bool ok = false; |
---|
810 | if (channel) |
---|
811 | - channel->Open(); |
---|
812 | + ok = channel->Open(); |
---|
813 | else |
---|
814 | ok = true; |
---|
815 | |
---|
816 | diff --git a/mythtv/libs/libmythtv/tvremoteutil.cpp b/mythtv/libs/libmythtv/tvremoteutil.cpp |
---|
817 | index 6993aa0..8550a7d 100644 |
---|
818 | --- a/mythtv/libs/libmythtv/tvremoteutil.cpp |
---|
819 | +++ b/mythtv/libs/libmythtv/tvremoteutil.cpp |
---|
820 | @@ -118,7 +118,9 @@ void RemoteStopRecording(const ProgramInfo *pginfo) |
---|
821 | QStringList strlist(QString("STOP_RECORDING")); |
---|
822 | pginfo->ToStringList(strlist); |
---|
823 | |
---|
824 | - gContext->SendReceiveStringList(strlist); |
---|
825 | + if (!gContext->SendReceiveStringList(strlist)) |
---|
826 | + VERBOSE(VB_IMPORTANT, |
---|
827 | + "SendReceiveStringList(STOP_RECORDING) failed"); |
---|
828 | } |
---|
829 | |
---|
830 | void RemoteCancelNextRecording(uint cardid, bool cancel) |
---|
831 | @@ -127,7 +129,9 @@ void RemoteCancelNextRecording(uint cardid, bool cancel) |
---|
832 | strlist << "CANCEL_NEXT_RECORDING"; |
---|
833 | strlist << QString::number((cancel) ? 1 : 0); |
---|
834 | |
---|
835 | - gContext->SendReceiveStringList(strlist); |
---|
836 | + if (!gContext->SendReceiveStringList(strlist)) |
---|
837 | + VERBOSE(VB_IMPORTANT, |
---|
838 | + "SendReceiveStringList(CANCEL_NEXT_RECORDING) failed"); |
---|
839 | } |
---|
840 | |
---|
841 | RemoteEncoder *RemoteRequestNextFreeRecorder(int curr) |
---|
842 | @@ -269,7 +273,8 @@ void RemoteSendMessage(const QString &message) |
---|
843 | QStringList strlist( "MESSAGE" ); |
---|
844 | strlist << message; |
---|
845 | |
---|
846 | - gContext->SendReceiveStringList(strlist); |
---|
847 | + if (!gContext->SendReceiveStringList(strlist)) |
---|
848 | + VERBOSE(VB_IMPORTANT, "SendReceiveStringList(MESSAGE) failed"); |
---|
849 | } |
---|
850 | |
---|
851 | void RemoteGeneratePreviewPixmap(ProgramInfo *pginfo) |
---|
852 | @@ -277,7 +282,8 @@ void RemoteGeneratePreviewPixmap(ProgramInfo *pginfo) |
---|
853 | QStringList strlist( "QUERY_GENPIXMAP" ); |
---|
854 | pginfo->ToStringList(strlist); |
---|
855 | |
---|
856 | - gContext->SendReceiveStringList(strlist); |
---|
857 | + if (!gContext->SendReceiveStringList(strlist)) |
---|
858 | + VERBOSE(VB_IMPORTANT, "SendReceiveStringList(QUERY_GENPIXMAP) failed"); |
---|
859 | } |
---|
860 | |
---|
861 | bool RemoteIsBusy(uint cardid, TunedInputInfo &busy_input) |
---|
862 | @@ -335,9 +341,8 @@ bool RemoteGetRecordingStatus( |
---|
863 | { |
---|
864 | strlist = QStringList(cmd); |
---|
865 | strlist << "GET_STATE"; |
---|
866 | - gContext->SendReceiveStringList(strlist); |
---|
867 | |
---|
868 | - if (strlist.empty()) |
---|
869 | + if (!gContext->SendReceiveStringList(strlist) || strlist.empty()) |
---|
870 | break; |
---|
871 | |
---|
872 | state = strlist[0].toInt(); |
---|
873 | @@ -354,7 +359,13 @@ bool RemoteGetRecordingStatus( |
---|
874 | |
---|
875 | strlist = QStringList(QString("QUERY_RECORDER %1").arg(cardid)); |
---|
876 | strlist << "GET_RECORDING"; |
---|
877 | - gContext->SendReceiveStringList(strlist); |
---|
878 | + if (!gContext->SendReceiveStringList(strlist)) |
---|
879 | + { |
---|
880 | + VERBOSE(VB_IMPORTANT, |
---|
881 | + QString("SendReceiveStringList(%1, GET_RECORDING)") |
---|
882 | + .arg(cardid)); |
---|
883 | + break; |
---|
884 | + } |
---|
885 | |
---|
886 | ProgramInfo progInfo; |
---|
887 | QStringList::const_iterator it = strlist.constBegin(); |
---|
888 | diff --git a/mythtv/libs/libmythtv/util-opengl.cpp b/mythtv/libs/libmythtv/util-opengl.cpp |
---|
889 | index 75e6e54..65b9390 100644 |
---|
890 | --- a/mythtv/libs/libmythtv/util-opengl.cpp |
---|
891 | +++ b/mythtv/libs/libmythtv/util-opengl.cpp |
---|
892 | @@ -353,7 +353,8 @@ void *get_gl_proc_address(const QString &procName) |
---|
893 | |
---|
894 | int get_gl_texture_rect_type(const QString &ext) |
---|
895 | { |
---|
896 | - init_opengl(); |
---|
897 | + if (!init_opengl()) |
---|
898 | + return -1; |
---|
899 | |
---|
900 | if (ext.contains("GL_NV_texture_rectangle")) |
---|
901 | return GL_TEXTURE_RECTANGLE_NV; |
---|
902 | @@ -367,9 +368,7 @@ int get_gl_texture_rect_type(const QString &ext) |
---|
903 | |
---|
904 | bool has_gl_fbuffer_object_support(const QString &ext) |
---|
905 | { |
---|
906 | - init_opengl(); |
---|
907 | - |
---|
908 | - if (!ext.contains("GL_EXT_framebuffer_object")) |
---|
909 | + if (!init_opengl() || !ext.contains("GL_EXT_framebuffer_object")) |
---|
910 | return false; |
---|
911 | |
---|
912 | return (gMythGLGenFramebuffersEXT && |
---|
913 | @@ -381,9 +380,7 @@ bool has_gl_fbuffer_object_support(const QString &ext) |
---|
914 | |
---|
915 | bool has_gl_fragment_program_support(const QString &ext) |
---|
916 | { |
---|
917 | - init_opengl(); |
---|
918 | - |
---|
919 | - if (!ext.contains("GL_ARB_fragment_program")) |
---|
920 | + if (!init_opengl() || !ext.contains("GL_ARB_fragment_program")) |
---|
921 | return false; |
---|
922 | |
---|
923 | return (gMythGLGenProgramsARB && |
---|
924 | @@ -396,9 +393,7 @@ bool has_gl_fragment_program_support(const QString &ext) |
---|
925 | |
---|
926 | bool has_glx_video_sync_support(const QString &glx_ext) |
---|
927 | { |
---|
928 | - init_opengl(); |
---|
929 | - |
---|
930 | - if (!glx_ext.contains("GLX_SGI_video_sync")) |
---|
931 | + if (!init_opengl() || !glx_ext.contains("GLX_SGI_video_sync")) |
---|
932 | return false; |
---|
933 | |
---|
934 | return gMythGLXGetVideoSyncSGI && gMythGLXWaitVideoSyncSGI; |
---|
935 | @@ -406,9 +401,7 @@ bool has_glx_video_sync_support(const QString &glx_ext) |
---|
936 | |
---|
937 | bool has_gl_pixelbuffer_object_support(const QString &ext) |
---|
938 | { |
---|
939 | - init_opengl(); |
---|
940 | - |
---|
941 | - if (!ext.contains("GL_ARB_pixel_buffer_object")) |
---|
942 | + if (!init_opengl() || !ext.contains("GL_ARB_pixel_buffer_object")) |
---|
943 | return false; |
---|
944 | |
---|
945 | return (gMythGLMapBufferARB && |
---|
946 | @@ -421,9 +414,7 @@ bool has_gl_pixelbuffer_object_support(const QString &ext) |
---|
947 | |
---|
948 | bool has_gl_nvfence_support(const QString &ext) |
---|
949 | { |
---|
950 | - init_opengl(); |
---|
951 | - |
---|
952 | - if (!ext.contains("GL_NV_fence")) |
---|
953 | + if (!init_opengl() || !ext.contains("GL_NV_fence")) |
---|
954 | return false; |
---|
955 | |
---|
956 | return (gMythGLGenFencesNV && |
---|
957 | @@ -434,9 +425,7 @@ bool has_gl_nvfence_support(const QString &ext) |
---|
958 | |
---|
959 | bool has_gl_applefence_support(const QString &ext) |
---|
960 | { |
---|
961 | - init_opengl(); |
---|
962 | - |
---|
963 | - if (!ext.contains("GL_APPLE_fence")) |
---|
964 | + if (!init_opengl() || !ext.contains("GL_APPLE_fence")) |
---|
965 | return false; |
---|
966 | |
---|
967 | return (gMythGLGenFencesAPPLE && |
---|
968 | @@ -447,9 +436,7 @@ bool has_gl_applefence_support(const QString &ext) |
---|
969 | |
---|
970 | bool has_glx_swapinterval_support(const QString &glx_ext) |
---|
971 | { |
---|
972 | - init_opengl(); |
---|
973 | - |
---|
974 | - if (!glx_ext.contains("GLX_SGI_swap_control")) |
---|
975 | + if (!init_opengl() || !glx_ext.contains("GLX_SGI_swap_control")) |
---|
976 | return false; |
---|
977 | |
---|
978 | return gMythGLXSwapIntervalSGI; |
---|
979 | @@ -457,9 +444,7 @@ bool has_glx_swapinterval_support(const QString &glx_ext) |
---|
980 | |
---|
981 | bool has_wgl_swapinterval_support(const QString &ext) |
---|
982 | { |
---|
983 | - init_opengl(); |
---|
984 | - |
---|
985 | - if (!ext.contains("WGL_EXT_swap_control")) |
---|
986 | + if (!init_opengl() || !ext.contains("WGL_EXT_swap_control")) |
---|
987 | return false; |
---|
988 | |
---|
989 | return gMythWGLSwapIntervalEXT; |
---|
990 | @@ -467,9 +452,7 @@ bool has_wgl_swapinterval_support(const QString &ext) |
---|
991 | |
---|
992 | bool has_gl_ycbcrmesa_support(const QString &ext) |
---|
993 | { |
---|
994 | - init_opengl(); |
---|
995 | - |
---|
996 | - if (!ext.contains("GL_MESA_ycbcr_texture")) |
---|
997 | + if (!init_opengl() || !ext.contains("GL_MESA_ycbcr_texture")) |
---|
998 | return false; |
---|
999 | |
---|
1000 | return true; |
---|
1001 | diff --git a/mythtv/libs/libmythtv/videodisplayprofile.cpp b/mythtv/libs/libmythtv/videodisplayprofile.cpp |
---|
1002 | index 4f3f915..78d81cf 100644 |
---|
1003 | --- a/mythtv/libs/libmythtv/videodisplayprofile.cpp |
---|
1004 | +++ b/mythtv/libs/libmythtv/videodisplayprofile.cpp |
---|
1005 | @@ -799,8 +799,13 @@ QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) |
---|
1006 | void VideoDisplayProfile::SetDefaultProfileName( |
---|
1007 | const QString &profilename, const QString &hostname) |
---|
1008 | { |
---|
1009 | - gContext->SaveSettingOnHost( |
---|
1010 | - "DefaultVideoPlaybackProfile", profilename, hostname); |
---|
1011 | + if (!gContext->SaveSettingOnHost("DefaultVideoPlaybackProfile", profilename, |
---|
1012 | + hostname)) |
---|
1013 | + { |
---|
1014 | + VERBOSE(VB_IMPORTANT, |
---|
1015 | + QString("SaveSettingOnHost(DefaultVideoPlaybackProfile, " |
---|
1016 | + "%1, %2) failed").arg(profilename).arg(hostname)); |
---|
1017 | + } |
---|
1018 | } |
---|
1019 | |
---|
1020 | uint VideoDisplayProfile::GetProfileGroupID(const QString &profilename, |
---|
1021 | diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp |
---|
1022 | index 769700d..931189d 100644 |
---|
1023 | --- a/mythtv/libs/libmythtv/videoout_opengl.cpp |
---|
1024 | +++ b/mythtv/libs/libmythtv/videoout_opengl.cpp |
---|
1025 | @@ -480,7 +480,9 @@ bool VideoOutputOpenGL::SetupDeinterlace( |
---|
1026 | { |
---|
1027 | gl_videochain->SetDeinterlacing(false); |
---|
1028 | gl_videochain->SetSoftwareDeinterlacer(QString::null); |
---|
1029 | - VideoOutput::SetupDeinterlace(interlaced, overridefilter); |
---|
1030 | + if (!VideoOutput::SetupDeinterlace(interlaced, overridefilter)) |
---|
1031 | + return false; |
---|
1032 | + |
---|
1033 | if (m_deinterlacing) |
---|
1034 | gl_videochain->SetSoftwareDeinterlacer(m_deintfiltername); |
---|
1035 | |
---|