Ticket #5425: libs_libmythtv-unused-value.patch
File libs_libmythtv-unused-value.patch, 18.9 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
Qt can do a lot of work in a 'new object()' then most From: Erik Hovland <erik@hovland.org> libraries. So you often see all sorts of new calls in Qt that don't actually assign the pointer. Don't worry, Qt will automagically clean it up later. Anyhow, it seems that the OSDGenericTree class is designed much the same. So the assignments of these new objects are superfluous. --- libs/libmythtv/NuppelVideoPlayer.cpp | 6 - libs/libmythtv/tv_play.cpp | 213 +++++++++++++++------------------- 2 files changed, 96 insertions(+), 123 deletions(-) diff --git a/libs/libmythtv/NuppelVideoPlayer.cpp b/libs/libmythtv/NuppelVideoPlayer.cpp index 6c52cc7..e59ab11 100644
a b void NuppelVideoPlayer::ChangeCaptionTrack(int dir) 6680 6680 */ 6681 6681 void NuppelVideoPlayer::DisplayAVSubtitles(void) 6682 6682 { 6683 OSDSet *subtitleOSD ;6683 OSDSet *subtitleOSD = osd->GetSet("subtitles"); 6684 6684 bool setVisible = false; 6685 6685 VideoFrame *currentFrame = videoOutput->GetLastShownFrame(); 6686 6686 6687 if (!osd || !currentFrame || ! (subtitleOSD = osd->GetSet("subtitles")))6687 if (!osd || !currentFrame || !subtitleOSD) 6688 6688 return; 6689 6689 6690 6690 subtitleLock.lock(); 6691 6691 6692 subtitleOSD = osd->GetSet("subtitles");6693 6694 6692 // hide the subs if they have been long enough in the screen without 6695 6693 // new subtitles replacing them 6696 6694 if (osdHasSubtitles && currentFrame->timecode >= osdSubtitlesExpireAt) -
libs/libmythtv/tv_play.cpp
diff --git a/libs/libmythtv/tv_play.cpp b/libs/libmythtv/tv_play.cpp index de6ebdd..9794412 100644
a b void TV::BuildOSDTreeMenu(void) 7488 7488 delete treeMenu; 7489 7489 7490 7490 treeMenu = new OSDGenericTree(NULL, "treeMenu"); 7491 OSDGenericTree *item , *subitem;7491 OSDGenericTree *item; 7492 7492 7493 7493 if (StateIsLiveTV(GetState())) 7494 7494 FillMenuLiveTV(treeMenu); … … void TV::BuildOSDTreeMenu(void) 7520 7520 7521 7521 bool sel = (i != kAspect_Off) ? (aspectoverride == i) : 7522 7522 (aspectoverride <= kAspect_Off) || (aspectoverride >= kAspect_END); 7523 subitem =new OSDGenericTree(item, toString((AspectOverrideMode) i),7524 7525 7523 new OSDGenericTree(item, toString((AspectOverrideMode) i), 7524 QString("TOGGLEASPECT%1").arg(i), 7525 (sel) ? 1 : 0, NULL, "ASPECTGROUP"); 7526 7526 } 7527 7527 7528 7528 AdjustFillMode adjustfill = nvp->GetAdjustFill(); … … void TV::BuildOSDTreeMenu(void) 7531 7531 { 7532 7532 bool sel = (i != kAdjustFill_Off) ? (adjustfill == i) : 7533 7533 (adjustfill <= kAdjustFill_Off) || (adjustfill >= kAdjustFill_END); 7534 subitem =new OSDGenericTree(item, toString((AdjustFillMode) i),7535 7536 7534 new OSDGenericTree(item, toString((AdjustFillMode) i), 7535 QString("TOGGLEFILL%1").arg(i), 7536 (sel) ? 1 : 0, NULL, "ADJUSTFILLGROUP"); 7537 7537 } 7538 7538 7539 7539 uint sup = kPictureAttributeSupported_None; … … void TV::BuildOSDTreeMenu(void) 7546 7546 { 7547 7547 if (!item) 7548 7548 item = new OSDGenericTree(treeMenu, tr("Adjust Picture")); 7549 subitem = new OSDGenericTree( 7550 7551 QString("TOGGLEPICCONTROLS%1").arg(i));7549 7550 new OSDGenericTree(item, toString((PictureAttribute) i), 7551 QString("TOGGLEPICCONTROLS%1").arg(i)); 7552 7552 } 7553 7553 } 7554 7554 7555 item = new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), 7556 "TOGGLEMANUALZOOM"); 7555 new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), "TOGGLEMANUALZOOM"); 7557 7556 7558 7557 item = new OSDGenericTree(treeMenu, tr("Adjust Audio Sync"), "TOGGLEAUDIOSYNC"); 7559 7558 7560 7559 int speedX100 = (int)(round(normal_speed * 100)); 7561 7560 7562 7561 item = new OSDGenericTree(treeMenu, tr("Adjust Time Stretch"), "ADJUSTSTRETCH"); 7563 subitem =new OSDGenericTree(item, tr("Toggle"), "TOGGLESTRETCH");7564 subitem = newOSDGenericTree(item, tr("Adjust"), "ADJUSTSTRETCH");7565 subitem =new OSDGenericTree(item, tr("0.5X"), "ADJUSTSTRETCH0.5",7566 7567 7568 subitem =new OSDGenericTree(item, tr("0.9X"), "ADJUSTSTRETCH0.9",7569 7570 7571 subitem =new OSDGenericTree(item, tr("1.0X"), "ADJUSTSTRETCH1.0",7572 7573 7574 subitem =new OSDGenericTree(item, tr("1.1X"), "ADJUSTSTRETCH1.1",7575 7576 7577 subitem =new OSDGenericTree(item, tr("1.2X"), "ADJUSTSTRETCH1.2",7578 7579 7580 subitem =new OSDGenericTree(item, tr("1.3X"), "ADJUSTSTRETCH1.3",7581 7582 7583 subitem =new OSDGenericTree(item, tr("1.4X"), "ADJUSTSTRETCH1.4",7584 7585 7586 subitem =new OSDGenericTree(item, tr("1.5X"), "ADJUSTSTRETCH1.5",7587 7588 7562 new OSDGenericTree(item, tr("Toggle"), "TOGGLESTRETCH"); 7563 OSDGenericTree(item, tr("Adjust"), "ADJUSTSTRETCH"); 7564 new OSDGenericTree(item, tr("0.5X"), "ADJUSTSTRETCH0.5", 7565 (speedX100 == 50) ? 1 : 0, NULL, 7566 "STRETCHGROUP"); 7567 new OSDGenericTree(item, tr("0.9X"), "ADJUSTSTRETCH0.9", 7568 (speedX100 == 90) ? 1 : 0, NULL, 7569 "STRETCHGROUP"); 7570 new OSDGenericTree(item, tr("1.0X"), "ADJUSTSTRETCH1.0", 7571 (speedX100 == 100) ? 1 : 0, NULL, 7572 "STRETCHGROUP"); 7573 new OSDGenericTree(item, tr("1.1X"), "ADJUSTSTRETCH1.1", 7574 (speedX100 == 110) ? 1 : 0, NULL, 7575 "STRETCHGROUP"); 7576 new OSDGenericTree(item, tr("1.2X"), "ADJUSTSTRETCH1.2", 7577 (speedX100 == 120) ? 1 : 0, NULL, 7578 "STRETCHGROUP"); 7579 new OSDGenericTree(item, tr("1.3X"), "ADJUSTSTRETCH1.3", 7580 (speedX100 == 130) ? 1 : 0, NULL, 7581 "STRETCHGROUP"); 7582 new OSDGenericTree(item, tr("1.4X"), "ADJUSTSTRETCH1.4", 7583 (speedX100 == 140) ? 1 : 0, NULL, 7584 "STRETCHGROUP"); 7585 new OSDGenericTree(item, tr("1.5X"), "ADJUSTSTRETCH1.5", 7586 (speedX100 == 150) ? 1 : 0, NULL, 7587 "STRETCHGROUP"); 7589 7588 7590 7589 // add scan mode override settings to menu 7591 7590 FrameScanType scan_type = kScan_Ignore; … … void TV::BuildOSDTreeMenu(void) 7610 7609 7611 7610 item = new OSDGenericTree( 7612 7611 treeMenu, tr("Video Scan"), "SCANMODE"); 7613 subitem = new OSDGenericTree( 7614 item, tr("Detect") + cur_mode, "SELECTSCAN_0", 7612 new OSDGenericTree(item, tr("Detect") + cur_mode, "SELECTSCAN_0", 7615 7613 (scan_type == kScan_Detect) ? 1 : 0, NULL, "SCANGROUP"); 7616 subitem = new OSDGenericTree( 7617 item, tr("Progressive"), "SELECTSCAN_3", 7614 new OSDGenericTree(item, tr("Progressive"), "SELECTSCAN_3", 7618 7615 (scan_type == kScan_Progressive) ? 1 : 0, NULL, "SCANGROUP"); 7619 subitem = new OSDGenericTree( 7620 item, tr("Interlaced (Normal)"), "SELECTSCAN_1", 7616 new OSDGenericTree(item, tr("Interlaced (Normal)"), "SELECTSCAN_1", 7621 7617 (scan_type == kScan_Interlaced) ? 1 : 0, NULL, "SCANGROUP"); 7622 subitem = new OSDGenericTree( 7623 item, tr("Interlaced (Reversed)"), "SELECTSCAN_2", 7618 new OSDGenericTree(item, tr("Interlaced (Reversed)"), "SELECTSCAN_2", 7624 7619 (scan_type == kScan_Intr2ndField) ? 1 : 0, NULL, "SCANGROUP"); 7625 7620 7626 7621 // add sleep items to menu 7627 7622 7628 7623 item = new OSDGenericTree(treeMenu, tr("Sleep"), "TOGGLESLEEPON"); 7629 7624 if (sleepTimer.isRunning()) 7630 subitem = new OSDGenericTree(item, tr("Sleep Off"), "TOGGLESLEEPON"); 7631 subitem = new OSDGenericTree(item, "30 " + tr("minutes"), "TOGGLESLEEP30"); 7632 subitem = new OSDGenericTree(item, "60 " + tr("minutes"), "TOGGLESLEEP60"); 7633 subitem = new OSDGenericTree(item, "90 " + tr("minutes"), "TOGGLESLEEP90"); 7634 subitem = new OSDGenericTree(item, "120 " + tr("minutes"), "TOGGLESLEEP120"); 7625 new OSDGenericTree(item, tr("Sleep Off"), "TOGGLESLEEPON"); 7626 7627 new OSDGenericTree(item, "30 " + tr("minutes"), "TOGGLESLEEP30"); 7628 new OSDGenericTree(item, "60 " + tr("minutes"), "TOGGLESLEEP60"); 7629 new OSDGenericTree(item, "90 " + tr("minutes"), "TOGGLESLEEP90"); 7630 new OSDGenericTree(item, "120 " + tr("minutes"), "TOGGLESLEEP120"); 7635 7631 } 7636 7632 7637 7633 void TV::FillMenuLiveTV(OSDGenericTree *treeMenu) 7638 7634 { 7639 OSDGenericTree *item , *subitem;7635 OSDGenericTree *item; 7640 7636 7641 7637 bool freeRecorders = (pipnvp != NULL); 7642 7638 if (!freeRecorders) … … void TV::FillMenuLiveTV(OSDGenericTree *treeMenu) 7647 7643 if (!gContext->GetNumSetting("JumpToProgramOSD", 1)) 7648 7644 { 7649 7645 item = new OSDGenericTree(treeMenu, tr("Jump to Program")); 7650 subitem =new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC");7646 new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC"); 7651 7647 if (lastProgram != NULL) 7652 subitem =new OSDGenericTree(item, lastProgram->title, "JUMPPREV");7648 new OSDGenericTree(item, lastProgram->title, "JUMPPREV"); 7653 7649 } 7654 7650 7655 7651 if (freeRecorders) 7656 7652 { 7657 7653 // Picture-in-Picture 7658 7654 item = new OSDGenericTree(treeMenu, tr("Picture-in-Picture")); 7659 subitem =new OSDGenericTree(item, tr("Enable/Disable"),7655 new OSDGenericTree(item, tr("Enable/Disable"), 7660 7656 "TOGGLEPIPMODE"); 7661 subitem =new OSDGenericTree(item, tr("Swap PiP/Main"), "SWAPPIP");7662 subitem =new OSDGenericTree(item, tr("Change Active Window"),7657 new OSDGenericTree(item, tr("Swap PiP/Main"), "SWAPPIP"); 7658 new OSDGenericTree(item, tr("Change Active Window"), 7663 7659 "TOGGLEPIPWINDOW"); 7664 7660 7665 7661 // Input switching … … void TV::FillMenuLiveTV(OSDGenericTree *treeMenu) 7714 7710 tr("I", "Input") + ":" + inputs[i].name; 7715 7711 } 7716 7712 7717 subitem = new OSDGenericTree(7718 item, name,7719 QString("SWITCHTOINPUT_%1").arg(inputs[i].inputid));7713 new OSDGenericTree(item, name, 7714 QString("SWITCHTOINPUT_%1") 7715 .arg(inputs[i].inputid)); 7720 7716 } 7721 7717 } 7722 7718 … … void TV::FillMenuLiveTV(OSDGenericTree *treeMenu) 7731 7727 item = new OSDGenericTree(treeMenu, tr("Switch Source")); 7732 7728 for (; sit != sources.end(); ++sit) 7733 7729 { 7734 subitem = new OSDGenericTree( 7735 item, SourceUtil::GetSourceName((*sit).sourceid), 7736 QString("SWITCHTOINPUT_%1").arg((*sit).inputid)); 7730 new OSDGenericTree(item, SourceUtil::GetSourceName((*sit).sourceid), 7731 QString("SWITCHTOINPUT_%1").arg((*sit).inputid)); 7737 7732 } 7738 7733 } 7739 7734 7740 7735 if (!persistentbrowsemode) 7741 { 7742 item = new OSDGenericTree( 7743 treeMenu, tr("Enable Browse Mode"), "TOGGLEBROWSE"); 7744 } 7736 new OSDGenericTree(treeMenu, tr("Enable Browse Mode"), "TOGGLEBROWSE"); 7745 7737 7746 item = new OSDGenericTree(treeMenu, tr("Previous Channel"), 7747 "PREVCHAN"); 7738 new OSDGenericTree(treeMenu, tr("Previous Channel"), "PREVCHAN"); 7748 7739 } 7749 7740 7750 7741 void TV::FillMenuPlaying(OSDGenericTree *treeMenu) 7751 7742 { 7752 OSDGenericTree *item , *subitem;7743 OSDGenericTree *item; 7753 7744 7754 7745 if (activerbuffer && activerbuffer->isDVD()) 7755 7746 { 7756 item = new OSDGenericTree( 7757 treeMenu, tr("DVD Root Menu"), "JUMPTODVDROOTMENU"); 7758 item = new OSDGenericTree( 7759 treeMenu, tr("DVD Chapter Menu"), "JUMPTODVDCHAPTERMENU"); 7747 new OSDGenericTree(treeMenu, tr("DVD Root Menu"), "JUMPTODVDROOTMENU"); 7748 new OSDGenericTree(treeMenu,tr("DVD Chapter Menu"), 7749 "JUMPTODVDCHAPTERMENU"); 7760 7750 7761 7751 return; 7762 7752 } … … void TV::FillMenuPlaying(OSDGenericTree *treeMenu) 7765 7755 7766 7756 item = new OSDGenericTree(treeMenu, tr("Jump to Program")); 7767 7757 7768 subitem =new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC");7758 new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC"); 7769 7759 if (lastProgram != NULL) 7770 subitem =new OSDGenericTree(item, lastProgram->title, "JUMPPREV");7760 new OSDGenericTree(item, lastProgram->title, "JUMPPREV"); 7771 7761 7772 7762 pbinfoLock.lock(); 7773 7763 7774 7764 if (JobQueue::IsJobQueuedOrRunning( 7775 7765 JOB_TRANSCODE, playbackinfo->chanid, playbackinfo->startts)) 7776 7766 { 7777 item = new OSDGenericTree(treeMenu, tr("Stop Transcoding"), 7778 "QUEUETRANSCODE"); 7767 new OSDGenericTree(treeMenu, tr("Stop Transcoding"), "QUEUETRANSCODE"); 7779 7768 } 7780 7769 else 7781 7770 { 7782 7771 item = new OSDGenericTree(treeMenu, tr("Begin Transcoding")); 7783 subitem = new OSDGenericTree(item, tr("Default"), 7784 "QUEUETRANSCODE"); 7785 subitem = new OSDGenericTree(item, tr("Autodetect"), 7786 "QUEUETRANSCODE_AUTO"); 7787 subitem = new OSDGenericTree(item, tr("High Quality"), 7788 "QUEUETRANSCODE_HIGH"); 7789 subitem = new OSDGenericTree(item, tr("Medium Quality"), 7790 "QUEUETRANSCODE_MEDIUM"); 7791 subitem = new OSDGenericTree(item, tr("Low Quality"), 7792 "QUEUETRANSCODE_LOW"); 7772 new OSDGenericTree(item, tr("Default"), "QUEUETRANSCODE"); 7773 new OSDGenericTree(item, tr("Autodetect"), "QUEUETRANSCODE_AUTO"); 7774 new OSDGenericTree(item, tr("High Quality"), "QUEUETRANSCODE_HIGH"); 7775 new OSDGenericTree(item, tr("Medium Quality"), "QUEUETRANSCODE_MEDIUM"); 7776 new OSDGenericTree(item, tr("Low Quality"), "QUEUETRANSCODE_LOW"); 7793 7777 } 7794 7778 7795 7779 item = new OSDGenericTree(treeMenu, tr("Commercial Auto-Skip")); 7796 subitem = new OSDGenericTree(item, tr("Auto-Skip OFF"), 7797 "TOGGLECOMMSKIP0", 7798 (autoCommercialSkip == 0) ? 1 : 0, NULL, 7799 "COMMSKIPGROUP"); 7800 subitem = new OSDGenericTree(item, tr("Auto-Skip Notify"), 7801 "TOGGLECOMMSKIP2", 7802 (autoCommercialSkip == 2) ? 1 : 0, NULL, 7803 "COMMSKIPGROUP"); 7804 subitem = new OSDGenericTree(item, tr("Auto-Skip ON"), 7805 "TOGGLECOMMSKIP1", 7806 (autoCommercialSkip == 1) ? 1 : 0, NULL, 7807 "COMMSKIPGROUP"); 7780 new OSDGenericTree(item, tr("Auto-Skip OFF"), "TOGGLECOMMSKIP0", 7781 (autoCommercialSkip == 0) ? 1 : 0, NULL, 7782 "COMMSKIPGROUP"); 7783 new OSDGenericTree(item, tr("Auto-Skip Notify"), "TOGGLECOMMSKIP2", 7784 (autoCommercialSkip == 2) ? 1 : 0, NULL, 7785 "COMMSKIPGROUP"); 7786 new OSDGenericTree(item, tr("Auto-Skip ON"), "TOGGLECOMMSKIP1", 7787 (autoCommercialSkip == 1) ? 1 : 0, NULL, 7788 "COMMSKIPGROUP"); 7808 7789 7809 7790 if (playbackinfo->GetAutoExpireFromRecorded()) 7810 7791 { 7811 item =new OSDGenericTree(treeMenu, tr("Turn Auto-Expire OFF"),7812 7792 new OSDGenericTree(treeMenu, tr("Turn Auto-Expire OFF"), 7793 "TOGGLEAUTOEXPIRE"); 7813 7794 } 7814 7795 else 7815 {7816 7796 item = new OSDGenericTree(treeMenu, tr("Turn Auto-Expire ON"), 7817 7797 "TOGGLEAUTOEXPIRE"); 7818 }7819 7798 7820 7799 pbinfoLock.unlock(); 7821 7800 7822 7801 item = new OSDGenericTree(treeMenu, tr("Schedule Recordings")); 7823 subitem = new OSDGenericTree(item, tr("Program Guide"), "GUIDE"); 7824 subitem = new OSDGenericTree(item, tr("Upcoming Recordings"), 7825 "VIEWSCHEDULED"); 7826 subitem = new OSDGenericTree(item, tr("Program Finder"), "FINDER"); 7827 subitem = new OSDGenericTree(item, tr("Edit Recording Schedule"), 7828 "SCHEDULE"); 7802 new OSDGenericTree(item, tr("Program Guide"), "GUIDE"); 7803 new OSDGenericTree(item, tr("Upcoming Recordings"), "VIEWSCHEDULED"); 7804 new OSDGenericTree(item, tr("Program Finder"), "FINDER"); 7805 new OSDGenericTree(item, tr("Edit Recording Schedule"), "SCHEDULE"); 7829 7806 } 7830 7807 7831 7808 bool TV::FillMenuTracks(OSDGenericTree *treeMenu, uint type) … … bool TV::FillMenuTracks(OSDGenericTree *treeMenu, uint type) 7876 7853 sel = activenvp->GetCaptionMode() & kTrackTypeTeletextCaptions; 7877 7854 } 7878 7855 else 7879 {7880 7856 return false; 7881 }7882 7857 7883 7858 const QStringList tracks = activenvp->GetTracks(type); 7884 7859 if (tracks.empty()) … … void TV::DoDisplayJumpMenu(void) 8682 8657 delete treeMenu; 8683 8658 8684 8659 treeMenu = new OSDGenericTree(NULL, "treeMenu"); 8685 OSDGenericTree *item , *subitem;8660 OSDGenericTree *item; 8686 8661 8687 8662 // Build jumpMenu of recorded program titles 8688 8663 ProgramInfo *p; … … void TV::DoDisplayJumpMenu(void) 8711 8686 int progIndex = plist.count(); 8712 8687 if (progIndex == 1) 8713 8688 { 8714 item =new OSDGenericTree(treeMenu, tr(Iprog.key()),8715 QString("JUMPPROG %1 0").arg(Iprog.key()));8689 new OSDGenericTree(treeMenu, tr(Iprog.key()), 8690 QString("JUMPPROG %1 0").arg(Iprog.key())); 8716 8691 } 8717 8692 else 8718 8693 { … … void TV::DoDisplayJumpMenu(void) 8721 8696 { 8722 8697 p = plist.at(i); 8723 8698 if (p->subtitle != "") 8724 subitem =new OSDGenericTree(item, tr(p->subtitle),8725 QString("JUMPPROG %1 %2").arg(Iprog.key()).arg(i)); 8699 new OSDGenericTree(item, tr(p->subtitle), 8700 QString("JUMPPROG %1 %2").arg(Iprog.key()).arg(i)); 8726 8701 else 8727 subitem =new OSDGenericTree(item, tr(p->title),8728 QString("JUMPPROG %1 %2").arg(Iprog.key()).arg(i)); 8702 new OSDGenericTree(item, tr(p->title), 8703 QString("JUMPPROG %1 %2").arg(Iprog.key()).arg(i)); 8729 8704 } 8730 8705 } 8731 8706 }