From 128a04a3039c5dffd08b29e97c9dd00625aa977d Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 24 Aug 2013 09:18:45 +0200 Subject: fixed an possible uninitialised variable in recordings menu --- HISTORY | 8 ++++++-- displaychannel.c | 10 ++++----- menudetailview.c | 12 +++++------ menudetailview.h | 2 +- menuitem.c | 8 +++++--- menuitem.h | 2 +- services/tvscraper.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ services/tvscrapper.h | 56 --------------------------------------------------- textwindow.c | 6 +++--- textwindow.h | 2 +- 10 files changed, 84 insertions(+), 78 deletions(-) create mode 100644 services/tvscraper.h delete mode 100644 services/tvscrapper.h diff --git a/HISTORY b/HISTORY index 86d8444..346b1bc 100644 --- a/HISTORY +++ b/HISTORY @@ -221,5 +221,9 @@ Version 0.1.2 - Fixed a bug if switching to a invalid channel Version 0.1.3 -- Added TVScrapper support, if TVScrapper is used scrapped images are - displayed in various EPG views +- Added TVScraper support, if TVScraper is used scraped images are + displayed in various EPG views + +Version 0.1.4 +- changed service interface for tvscraper +- fixed an possible uninitialised variable in recordings menu diff --git a/displaychannel.c b/displaychannel.c index f0af9ac..ce04d3f 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -2,7 +2,7 @@ #include "symbols/dolbydigital.xpm" #include "displaychannel.h" -#include "services/tvscrapper.h" +#include "services/tvscraper.h" cNopacityDisplayChannel::cNopacityDisplayChannel(bool WithInfo) { if (firstDisplay) { @@ -689,11 +689,11 @@ void cNopacityDisplayChannel::DrawPoster(const cEvent *event) { osd->DestroyPixmap(pixmapPoster); pixmapPoster = NULL; } - static cPlugin *pTVScrapper = cPluginManager::GetPlugin("tvscrapper"); - if (pTVScrapper) { - TVScrapperGetPosterOrBanner call; + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper) { + TVScraperGetPosterOrBanner call; call.event = event; - if (pTVScrapper->Service("TVScrapperGetPosterOrBanner", &call)) { + if (pTVScraper->Service("TVScraperGetPosterOrBanner", &call)) { int mediaWidth = 0; int mediaHeight = 0; if (call.type == typeSeries) { diff --git a/menudetailview.c b/menudetailview.c index 2f5af0c..ff79e25 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -290,11 +290,11 @@ void cNopacityMenuDetailEventView::SetFonts(void) { void cNopacityMenuDetailEventView::SetContent(void) { if (event) { - static cPlugin *pTVScrapper = cPluginManager::GetPlugin("tvscrapper"); - if (pTVScrapper) { + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper) { mediaInfo.event = event; mediaInfo.isRecording = false; - if (pTVScrapper->Service("TVScrapperGetFullInformation", &mediaInfo)) { + if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) { hasAdditionalMedia = true; } } @@ -603,11 +603,11 @@ void cNopacityMenuDetailRecordingView::SetContent(void) { if (recording) { const cEvent *event = info->GetEvent(); if (event) { - static cPlugin *pTVScrapper = cPluginManager::GetPlugin("tvscrapper"); - if (pTVScrapper) { + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper) { mediaInfo.event = event; mediaInfo.isRecording = true; - if (pTVScrapper->Service("TVScrapperGetFullInformation", &mediaInfo)) { + if (pTVScraper->Service("TVScraperGetFullInformation", &mediaInfo)) { hasAdditionalMedia = true; } } diff --git a/menudetailview.h b/menudetailview.h index 4f30759..80df2d7 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -26,7 +26,7 @@ protected: cPixmap *pixmapLogo; cPixmap *pixmapContent; cPixmap *pixmapPoster; - TVScrapperGetFullInformation mediaInfo; + TVScraperGetFullInformation mediaInfo; bool hasAdditionalMedia; void DrawTextWrapper(cTextWrapper *wrapper, int top); int HeightActorPics(void); diff --git a/menuitem.c b/menuitem.c index c58ec6d..9f83992 100644 --- a/menuitem.c +++ b/menuitem.c @@ -917,6 +917,8 @@ cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, const cRecordi this->Total = Total; this->New = New; this->vidWin = vidWin; + posterWidth = 0; + posterHeight = 0; } cNopacityRecordingMenuItem::~cNopacityRecordingMenuItem(void) { @@ -964,11 +966,11 @@ void cNopacityRecordingMenuItem::SetPoster(void) { const cRecordingInfo *info = Recording->Info(); if (info) { const cEvent *event = info->GetEvent(); - static cPlugin *pTVScrapper = cPluginManager::GetPlugin("tvscrapper"); - if (pTVScrapper && event) { + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper && event) { poster.event = event; poster.isRecording = true; - if (pTVScrapper->Service("TVScrapperGetPoster", &poster)) { + if (pTVScraper->Service("TVScraperGetPoster", &poster)) { hasPoster = true; int posterWidthOrig = poster.media.width; int posterHeightOrig = poster.media.height; diff --git a/menuitem.h b/menuitem.h index 60709bd..b4c0aaf 100644 --- a/menuitem.h +++ b/menuitem.h @@ -157,7 +157,7 @@ private: bool isFolder; bool hasPoster; int posterWidth, posterHeight; - TVScrapperGetPoster poster; + TVScraperGetPoster poster; int Level, Total, New; cRect *vidWin; std::string strRecName; diff --git a/services/tvscraper.h b/services/tvscraper.h new file mode 100644 index 0000000..fc278ad --- /dev/null +++ b/services/tvscraper.h @@ -0,0 +1,56 @@ +enum tvMediaType { + typeSeries, + typeMovie, + typeNone, +}; + +struct tvMedia { + std::string path; + int width; + int height; +}; + +struct tvActor { + std::string name; + std::string role; + tvMedia thumb; +}; + +// Data structure for service "TVScraper-GetPosterOrBanner" +struct TVScraperGetPosterOrBanner +{ +// in + const cEvent *event; // search image for this event +//out + tvMediaType type; //typeSeries or typeMovie + tvMedia media; //banner or poster +}; + +// Data structure for service "TVScraper-GetPoster" +struct TVScraperGetPoster +{ +// in + const cEvent *event; // search image for this event + bool isRecording; // search in current EPG or recordings +//out + tvMedia media; //poster +}; + + +/* Data structure for service "TVScraper-GetFullEPGInformation" +if type == typeMovie a poster and a fanart image is delivered +if type == typeSeries a banner and up to three posters and fanarts are delivered +*/ +struct TVScraperGetFullInformation +{ +// in + const cEvent *event; // search all media for this event + bool isRecording; // search in current EPG or recordings +//out + tvMediaType type; + tvMedia banner; + std::vector posters; + std::vector fanart; + std::vector actors; + std::string description; +}; \ No newline at end of file diff --git a/services/tvscrapper.h b/services/tvscrapper.h deleted file mode 100644 index 5541608..0000000 --- a/services/tvscrapper.h +++ /dev/null @@ -1,56 +0,0 @@ -enum tvMediaType { - typeSeries, - typeMovie, - typeNone, -}; - -struct tvMedia { - std::string path; - int width; - int height; -}; - -struct tvActor { - std::string name; - std::string role; - tvMedia thumb; -}; - -// Data structure for service "TVScrapper-GetPosterOrBanner" -struct TVScrapperGetPosterOrBanner -{ -// in - const cEvent *event; // search image for this event -//out - tvMediaType type; //typeSeries or typeMovie - tvMedia media; //banner or poster -}; - -// Data structure for service "TVScrapper-GetPoster" -struct TVScrapperGetPoster -{ -// in - const cEvent *event; // search image for this event - bool isRecording; // search in current EPG or recordings -//out - tvMedia media; //poster -}; - - -/* Data structure for service "TVScrapper-GetFullEPGInformation" -if type == typeMovie a poster and a fanart image is delivered -if type == typeSeries a banner and up to three posters and fanarts are delivered -*/ -struct TVScrapperGetFullInformation -{ -// in - const cEvent *event; // search all media for this event - bool isRecording; // search in current EPG or recordings -//out - tvMediaType type; - tvMedia banner; - std::vector posters; - std::vector fanart; - std::vector actors; - std::string description; -}; \ No newline at end of file diff --git a/textwindow.c b/textwindow.c index 013f19d..09d3da7 100644 --- a/textwindow.c +++ b/textwindow.c @@ -34,11 +34,11 @@ cNopacityTextWindow::~cNopacityTextWindow(void) { } void cNopacityTextWindow::SetPoster(const cEvent *event, bool isRecording) { - static cPlugin *pTVScrapper = cPluginManager::GetPlugin("tvscrapper"); - if (pTVScrapper && event) { + static cPlugin *pTVScraper = cPluginManager::GetPlugin("tvscraper"); + if (pTVScraper && event) { poster.event = event; poster.isRecording = isRecording; - if (pTVScrapper->Service("TVScrapperGetPoster", &poster)) { + if (pTVScraper->Service("TVScraperGetPoster", &poster)) { hasPoster = true; int posterWidthOrig = poster.media.width; int posterHeightOrig = poster.media.height; diff --git a/textwindow.h b/textwindow.h index e499553..0fe1a9e 100644 --- a/textwindow.h +++ b/textwindow.h @@ -17,7 +17,7 @@ private: bool drawTextTall; bool drawTextFull; bool hasPoster; - TVScrapperGetPoster poster; + TVScraperGetPoster poster; int posterWidth, posterHeight; bool SetTextScroller(int border, int left); void CreatePixmap(void); -- cgit v1.2.3