Ticket #6093: 6093-v2.patch
File 6093-v2.patch, 8.5 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
2698 2698 if (*buf == 0x02) 2699 2699 { 2700 2700 buf += 3; 2701 /* 2702 cerr<<QString("vbi_dvb(%1,%2)") 2703 .arg((int)(*(buf+1))) 2704 .arg((int)(*(buf+2))).toAscii().constData() 2705 <<endl; 2706 */ 2701 2707 ttd->Decode(buf+1, VBI_DVB); 2702 2708 } 2703 2709 else if (*buf == 0x03) 2704 2710 { 2705 2711 buf += 3; 2712 /* 2713 cerr<<QString("sub_dvb(%1,%2)") 2714 .arg((int)(*(buf+1))) 2715 .arg((int)(*(buf+2))).toAscii().constData() 2716 <<endl; 2706 2717 ttd->Decode(buf+1, VBI_DVB_SUBTITLE); 2718 */ 2707 2719 } 2708 2720 else if (*buf == 0xff) 2709 2721 { 2710 2722 buf += 3; 2723 // cerr<<"dvb(0xff)"<<endl; 2711 2724 } 2712 2725 else 2713 2726 { … … 3521 3534 int subIdx = selectedTrack[kTrackTypeSubtitle].av_stream_index; 3522 3535 avcodeclock.unlock(); 3523 3536 3537 static AVSubtitle subtitle; 3538 memset(&subtitle, 0, sizeof(AVSubtitle)); 3539 3524 3540 while (!have_err && len > 0) 3525 3541 { 3526 3542 int ret = 0; … … 3927 3943 case CODEC_TYPE_SUBTITLE: 3928 3944 { 3929 3945 int gotSubtitles = 0; 3930 AVSubtitle subtitle;3931 memset(&subtitle, 0, sizeof(AVSubtitle));3932 3946 3933 3947 if (ringBuffer->isDVD()) 3934 3948 { … … 3954 3968 avcodec_decode_subtitle(curstream->codec, 3955 3969 &subtitle, &gotSubtitles, 3956 3970 ptr, len); 3971 VERBOSE(VB_IMPORTANT, 3972 QString("avcodec_decode_subtitles -> %1") 3973 .arg(gotSubtitles)); 3957 3974 } 3975 else 3976 { 3977 VERBOSE(VB_IMPORTANT, "subtitles in silent stream"); 3978 } 3958 3979 3959 3980 // the subtitle decoder always consumes the whole packet 3960 3981 ptr += len; 3961 3982 len = 0; 3962 3983 3963 3984 if (gotSubtitles) 3964 { 3985 { 3986 VERBOSE(VB_IMPORTANT, "gotSubtitles"); 3965 3987 subtitle.start_display_time += pts; 3966 3988 subtitle.end_display_time += pts; 3967 3989 GetNVP()->AddAVSubtitle(subtitle); 3990 memset(&subtitle, 0, sizeof(AVSubtitle)); 3968 3991 } 3969 3992 3970 3993 break; -
libs/libmythui/mythuibuttonlist.h
65 65 */ 66 66 MythImage *getImage(const QString &name=""); 67 67 68 void SetImage(const QString &filename, const QString &name=""); 68 void SetImage(const QString &filename, const QString &name="", 69 bool force_reload = false); 70 QString GetImage(const QString &name="") const; 69 71 const QString Image() const; 70 72 71 73 void DisplayState(const QString &state, const QString &name); -
libs/libmythui/mythuibuttonlist.cpp
1247 1247 return NULL; 1248 1248 } 1249 1249 1250 void MythUIButtonListItem::SetImage(const QString &filename, const QString &name) 1250 void MythUIButtonListItem::SetImage( 1251 const QString &filename, const QString &name, bool force_reload) 1251 1252 { 1253 bool do_update = force_reload; 1252 1254 if (!name.isEmpty()) 1253 m_imageFilenames.insert(name, filename); 1254 else 1255 { 1256 QMap<QString, QString>::iterator it = m_imageFilenames.find(name); 1257 if (it == m_imageFilenames.end()) 1258 { 1259 m_imageFilenames.insert(name, filename); 1260 do_update = true; 1261 } 1262 else if (*it != filename) 1263 { 1264 *it = filename; 1265 do_update = true; 1266 } 1267 } 1268 else if (m_imageFilename != filename) 1269 { 1255 1270 m_imageFilename = filename; 1271 do_update = true; 1272 } 1256 1273 1257 if (m_parent )1274 if (m_parent && do_update) 1258 1275 m_parent->Update(); 1259 1276 } 1260 1277 1278 QString MythUIButtonListItem::GetImage(const QString &name) const 1279 { 1280 if (name.isEmpty()) 1281 return m_imageFilename; 1282 1283 QMap<QString, QString>::const_iterator it = m_imageFilenames.find(name); 1284 if (it != m_imageFilenames.end()) 1285 return *it; 1286 1287 return QString::null; 1288 } 1289 1261 1290 void MythUIButtonListItem::DisplayState(const QString &state, 1262 1291 const QString &name) 1263 1292 { 1264 1293 if (name.isEmpty()) 1265 1294 return; 1266 1295 1267 m_states.insert(name, state); 1296 bool do_update = false; 1297 QMap<QString, QString>::iterator it = m_states.find(name); 1298 if (it == m_states.end()) 1299 { 1300 m_states.insert(name, state); 1301 do_update = true; 1302 } 1303 else if (*it != state) 1304 { 1305 *it = state; 1306 do_update = true; 1307 } 1268 1308 1269 if (m_parent )1309 if (m_parent && do_update) 1270 1310 m_parent->Update(); 1271 1311 } 1272 1312 -
programs/mythfrontend/playbackbox.cpp
586 586 updateIcons(); 587 587 } 588 588 589 void PlaybackBox::UpdateProgramInfo(MythUIButtonListItem *item, bool is_sel) 589 void PlaybackBox::UpdateProgramInfo( 590 MythUIButtonListItem *item, bool is_sel, bool force_preview_reload) 590 591 { 591 592 if (!item) 592 593 return; … … 596 597 if (!pginfo) 597 598 return; 598 599 600 VERBOSE(VB_IMPORTANT, QString("UpdateProgramInfo(%1)") 601 .arg(pginfo->title)); 602 599 603 static const char *disp_flags[] = { "transcoding", "commflagging", }; 600 604 const bool disp_flag_stat[] = 601 605 { 602 606 !JobQueue::IsJobQueuedOrRunning( 603 607 JOB_TRANSCODE, pginfo->chanid, pginfo->recstartts), 604 608 !JobQueue::IsJobQueuedOrRunning( 605 JOB_COMMFLAG, pginfo->chanid, pginfo->recstartts),609 JOB_COMMFLAG, pginfo->chanid, pginfo->recstartts), 606 610 }; 607 611 608 612 for (uint i = 0; i < sizeof(disp_flags) / sizeof(char*); i++) 609 613 item->DisplayState(disp_flag_stat[i]?"yes":"no", disp_flags[i]); 610 614 611 QString imagefile = getPreviewImage(pginfo); 615 QString oldimgfile = item->GetImage("preview"); 616 QString imagefile = QString::null; 617 if (oldimgfile.isEmpty() || force_preview_reload || 618 ((is_sel && GetFocusWidget() == m_recordingList))) 619 { 620 VERBOSE(VB_IMPORTANT, QString( 621 "%1 || %2 || (%3 && %4) -> true") 622 .arg(oldimgfile.isEmpty()) 623 .arg(force_preview_reload) 624 .arg(is_sel) 625 .arg(GetFocusWidget() == m_recordingList)); 626 imagefile = getPreviewImage(pginfo); 627 } 628 612 629 if (!imagefile.isEmpty()) 613 item->SetImage(imagefile, "preview" );630 item->SetImage(imagefile, "preview", force_preview_reload); 614 631 615 632 if ((GetFocusWidget() == m_recordingList) && is_sel) 616 633 { … … 622 639 623 640 if (m_previewImage) 624 641 { 642 QString imagefile = getPreviewImage(pginfo); 625 643 m_previewImage->SetVisible(!imagefile.isEmpty()); 626 644 m_previewImage->SetFilename(imagefile); 627 645 m_previewImage->Load(); … … 3341 3359 return; 3342 3360 3343 3361 MythUIButtonListItem *sel_item = m_recordingList->GetItemCurrent(); 3344 UpdateProgramInfo(item, item == sel_item );3362 UpdateProgramInfo(item, item == sel_item, true); 3345 3363 } 3346 3364 3347 3365 bool check_lastmod(LastCheckedMap &elapsedtime, const QString &filename) -
programs/mythfrontend/playbackbox.h
291 291 void updateIcons(const ProgramInfo *pginfo = NULL); 292 292 void updateUsage(); 293 293 void updateGroupInfo(const QString &groupname); 294 void UpdateProgramInfo(MythUIButtonListItem *item, bool is_sel); 294 void UpdateProgramInfo(MythUIButtonListItem *item, bool is_sel, 295 bool force_preview_reload = false); 295 296 296 297 void SetTextFromMap(MythUIType *parent, QMap<QString, QString> &infoMap); 297 298 void ResetMap(MythUIType *parent, QMap<QString, QString> &infoMap);