From 853dec3df617a9f6a8c8bcd4b731462015218316 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 12 Apr 2008 14:15:53 +0000 Subject: [PATCH] Updates for windows --- abstractoption.cc | 15 +++- abstractoption.h | 9 ++- option.cc | 17 ++++- option.h | 15 +++- osdwin.h | 3 + playerlivetv.cc | 4 -- surfacewin.cc | 1 - vdrrequestpacket.cc | 4 ++ vdrrequestpacket.h | 4 ++ vdrresponsepacket.h | 5 ++ videowin.cc | 137 ++++++++++++++++++++++++++++++++++- videowin.h | 12 +++- vopts.cc | 169 ++++++++++++++++++++++++-------------------- vopts.h | 7 +- vvideolivetv.cc | 3 +- 15 files changed, 309 insertions(+), 96 deletions(-) diff --git a/abstractoption.cc b/abstractoption.cc index 78597d5..6c7408c 100644 --- a/abstractoption.cc +++ b/abstractoption.cc @@ -1,5 +1,5 @@ /* - Copyright 2007 Chris Tallon,Marten Richter + Copyright 2007-2008 Marten Richter This file is part of VOMP. @@ -18,6 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "abstractoption.h" +#include "vdr.h" +#include "option.h" bool AbstractOption::loadOptionsfromServer(VDR* vdr) { @@ -33,3 +35,14 @@ bool AbstractOption::addOptionPagesToWTB(WTabBar *wtb) { return true; } + +bool AbstractOption::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane) +{ + return true; +} + +bool AbstractOption::handleOptionChanges(Option* option) +{ + return false; +} + diff --git a/abstractoption.h b/abstractoption.h index 5b120da..ac6c5ba 100644 --- a/abstractoption.h +++ b/abstractoption.h @@ -1,5 +1,5 @@ /* - Copyright 2007 Chris Tallon, Marten Richter + Copyright 2007-2008 Marten Richter This file is part of VOMP. @@ -21,8 +21,12 @@ #ifndef ABSTRACT_OPTION_H #define ABSTRACT_OPTION_H +#include "defines.h" +#include "option.h" + class WTabBar; class VDR; +class WOptionPane; class AbstractOption { @@ -30,7 +34,8 @@ class AbstractOption virtual bool loadOptionsfromServer(VDR* vdr); virtual bool saveOptionstoServer(); virtual bool addOptionPagesToWTB(WTabBar *wtb); - + virtual bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane); + virtual bool handleOptionChanges(Option* option); }; #endif diff --git a/option.cc b/option.cc index ea42e60..c00b86a 100644 --- a/option.cc +++ b/option.cc @@ -23,13 +23,14 @@ Option::Option(UINT ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, const char* CONFIGKEY, UINT OPTIONTYPE, UINT NUMCHOICES, UINT DEFAULTCHOICE, UINT STARTINT, - const char * const * OPTIONS, const char * const * OPTIONKEYS) + const char * const * OPTIONS, const char * const * OPTIONKEYS, bool DELETESTRINGS, AbstractOption* handler) : id(ID), displayText(DISPLAYTEXT), configSection(CONFIGSECTION), configKey(CONFIGKEY), optionType(OPTIONTYPE), numChoices(NUMCHOICES), defaultChoice(DEFAULTCHOICE), startInt(STARTINT), - options(OPTIONS), optionkeys(OPTIONKEYS) + options(OPTIONS), optionkeys(OPTIONKEYS), deletestrings(DELETESTRINGS) { configChoice = defaultChoice; userSetChoice = defaultChoice; + opthandler = handler; // Now see if there is a config saved at vdr for this option char* config = VDR::getInstance()->configLoad(configSection, configKey); @@ -55,3 +56,15 @@ Option::Option(UINT ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, cons } } +Option::~Option() +{ + if (deletestrings && (optionType == TYPE_TEXT)) + { + for (UINT i = 0; i < numChoices; i++) + { + delete[] options[i]; + } + delete[] options; + } +} + diff --git a/option.h b/option.h index 0193ad6..b4bd3f6 100644 --- a/option.h +++ b/option.h @@ -21,15 +21,24 @@ #ifndef OPTION_H #define OPTION_H -#include "defines.h" #include +#include "defines.h" + +class AbstractOption; + +#include + +class Option; +using namespace std; +typedef vector Options; class Option { public: Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UINT optionType, UINT numChoices, UINT defaultChoice, UINT startInt, - const char * const * options, const char * const * optionkeys = NULL); + const char * const * options, const char * const * optionkeys = NULL, bool deletestrings = false, AbstractOption* handler = NULL); + ~Option(); UINT id; const char* displayText; @@ -41,6 +50,8 @@ class Option int startInt; const char * const * options; const char * const * optionkeys; + bool deletestrings; + AbstractOption* opthandler; UINT configChoice; UINT userSetChoice; diff --git a/osdwin.h b/osdwin.h index 355fdb0..756520d 100644 --- a/osdwin.h +++ b/osdwin.h @@ -62,6 +62,9 @@ class OsdWin : public Osd void EndPainting(); void setExternalDriving(DsAllocator* dsall); void Blank(); + DWORD getFilterCaps(); + DWORD getFilterType(){return filter_type;}; + void setFilterType(D3DTEXTUREFILTERTYPE type) {filter_type=type;}; private: LPDIRECT3D9 d3d; LPDIRECT3DDEVICE9 d3ddevice; diff --git a/playerlivetv.cc b/playerlivetv.cc index f32bf58..2ac7f4b 100644 --- a/playerlivetv.cc +++ b/playerlivetv.cc @@ -91,10 +91,6 @@ int PlayerLiveTV::shutdown() delete demuxer; -#ifdef WIN32 - CloseHandle(mutex); -#endif - return 1; } diff --git a/surfacewin.cc b/surfacewin.cc index fff0b09..2707bd7 100644 --- a/surfacewin.cc +++ b/surfacewin.cc @@ -20,7 +20,6 @@ #include "surfacewin.h" #include "osdwin.h" -#include #include "log.h" SurfaceWin::SurfaceWin(int id) diff --git a/vdrrequestpacket.cc b/vdrrequestpacket.cc index 9ec9c7a..bdf5f19 100644 --- a/vdrrequestpacket.cc +++ b/vdrrequestpacket.cc @@ -18,7 +18,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef WIN32 #include +#else + +#endif #include #include diff --git a/vdrrequestpacket.h b/vdrrequestpacket.h index 0943698..139d169 100644 --- a/vdrrequestpacket.h +++ b/vdrrequestpacket.h @@ -22,7 +22,11 @@ #define VDRREQUESTPACKET_H #include +#ifndef WIN32 #include +#else + +#endif #include #include "defines.h" diff --git a/vdrresponsepacket.h b/vdrresponsepacket.h index 1ede29a..0b0baab 100644 --- a/vdrresponsepacket.h +++ b/vdrresponsepacket.h @@ -21,7 +21,12 @@ #ifndef VDRRESPONSEPACKET_H #define VDRRESPONSEPACKET_H +#ifndef WIN32 #include +#else + +#endif + #include #include diff --git a/videowin.cc b/videowin.cc index 4f43304..a831d38 100644 --- a/videowin.cc +++ b/videowin.cc @@ -27,6 +27,7 @@ #include "audiowin.h" #include "wwinvideofilter.h" #include "wtabbar.h" +#include "woptionpane.h" #include "i18n.h" void AdjustWindow(); @@ -68,7 +69,7 @@ VideoWin::VideoWin() videoposy=0; aud_type=Audio::MPEG2_PES; iframemode=false;//We are not in Iframe mode at begining - + vmrdeinterlacing=2;//Best videofilterselected=-1; @@ -300,7 +301,67 @@ bool VideoWin::loadOptionsfromServer(VDR* vdr) } } } + name=vdr->configLoad("DirectShow","VMR9DeinterlacingMode"); + if (name != NULL) + { + if (STRCASECMP(name,"NoMix")==0) { + vmrdeinterlacing=0; + } else if (STRCASECMP(name,"None")==0) { + vmrdeinterlacing=1; + } else if (STRCASECMP(name,"Best")==0) { + vmrdeinterlacing=2; + } else if (STRCASECMP(name,"Bob")==0) { + vmrdeinterlacing=3; + } else if (STRCASECMP(name,"Weave")==0) { + vmrdeinterlacing=4; + } + } + + name=vdr->configLoad("DirectGraphics", "StretchFiltering"); + if (name!=NULL) { + if (STRCASECMP(name,"None")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_NONE); + } else if (STRCASECMP(name,"Point")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_POINT); + } else if (STRCASECMP(name,"Linear")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_LINEAR); + } + } + + + return true; + +} + +bool VideoWin::handleOptionChanges(Option* option) +{ + if( Video::handleOptionChanges(option)) return true; + switch(option->id) { + case 1: { + if (STRCASECMP(option->options[option->userSetChoice],"None")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_NONE); + } else if (STRCASECMP(option->options[option->userSetChoice],"Point")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_POINT); + } else if (STRCASECMP(option->options[option->userSetChoice],"Linear")==0) { + ((OsdWin*)Osd::getInstance())->setFilterType(D3DTEXF_LINEAR); + } return true; + } break; + case 2: { + if (STRCASECMP(option->options[option->userSetChoice],"NoMix")==0) { + vmrdeinterlacing=0; + } else if (STRCASECMP(option->options[option->userSetChoice],"None")==0) { + vmrdeinterlacing=1; + } else if (STRCASECMP(option->options[option->userSetChoice],"Best")==0) { + vmrdeinterlacing=2; + } else if (STRCASECMP(option->options[option->userSetChoice],"Bob")==0) { + vmrdeinterlacing=3; + } else if (STRCASECMP(option->options[option->userSetChoice],"Weave")==0) { + vmrdeinterlacing=4; + } + }break; + }; + return false; } @@ -313,6 +374,50 @@ bool VideoWin::saveOptionstoServer() return true; } +/*Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UINT optionType, + UINT numChoices, UINT defaultChoice, UINT startInt, + const char * const * options, const char * const * optionkeys = NULL, AbstractOption* handler=NULL);*/ + +bool VideoWin::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane) +{ + if (!Video::addOptionsToPanes(panenumber,options,pane)) return false; + + + Option* option; + if (panenumber == 2) + { + DWORD scalingcaps=((OsdWin*)Osd::getInstance())->getFilterCaps(); + char **scalingopts=new char *[3]; + int i=0; + scalingopts[i]=new char[strlen("None")+1]; + strcpy(scalingopts[i],"None"); + i++; + if ((scalingcaps & D3DPTFILTERCAPS_MINFPOINT)!=0 + && (scalingcaps & D3DPTFILTERCAPS_MAGFPOINT)!=0) { + scalingopts[i]=new char[strlen("Point")+1]; + strcpy(scalingopts[i],"Point"); + i++; + } + if ((scalingcaps & D3DPTFILTERCAPS_MINFLINEAR)!=0 + && (scalingcaps & D3DPTFILTERCAPS_MAGFLINEAR)!=0) { + scalingopts[i]=new char[strlen("Linear")+1]; + strcpy(scalingopts[i],"Linear"); + i++; + } + option = new Option(1 , "Video Stretching Filter", "DirectGraphics", "StretchFiltering", Option::TYPE_TEXT, i, (i-1), 0, scalingopts,NULL,true, this); + options->push_back(option); + pane->addOptionLine(option); + static const char* deintopts[]={"NoMix","None","Best","Bob","Weave"}; + option = new Option(2,"VMR9 Deinterlacing Mode", "DirectShow","VMR9DeinterlacingMode",Option::TYPE_TEXT,5,2,0,deintopts,NULL,false,this); + options->push_back(option); + pane->addOptionLine(option); + + + } + + return true; +} + IBaseFilter *VideoWin::getVideoFilter() { IBaseFilter *curfilter= NULL; @@ -547,7 +652,9 @@ int VideoWin::dsInitVideoFilter() Log::getInstance()->log("VideoWin", Log::WARN ,"Failed getting VMR9 Filterconfig interface!"); return 0; } + if (vmrdeinterlacing!=0) vmrfilconfig->SetNumberOfStreams(1);//Enter Mixing Mode vmrfilconfig->SetRenderingMode(VMR9Mode_Renderless); + vmrfilconfig->Release(); if (dsvmrrenderer->QueryInterface(IID_IVMRSurfaceAllocatorNotify9, @@ -561,6 +668,34 @@ int VideoWin::dsInitVideoFilter() allocatorvmr=new DsAllocator(); dsvmrsurfnotify->AdviseSurfaceAllocator(NULL,allocatorvmr); allocatorvmr->AdviseNotify(dsvmrsurfnotify); + + IVMRDeinterlaceControl9* deintctrl; + if (dsvmrrenderer->QueryInterface(IID_IVMRDeinterlaceControl9,(void**)&deintctrl)!=S_OK) + { + ReleaseMutex(filtermutex); + CleanupDS(); + Log::getInstance()->log("VideoWin", Log::WARN ,"Failed getting VMR9 Deinterlace control!"); + return 0; + } + /*turnoff*/ + switch (vmrdeinterlacing) + { + case 1: //No Deinterlasing + deintctrl->SetDeinterlaceMode(0xFFFFFFFF,(LPGUID)&GUID_NULL);//Turn Off + break; + case 2: //Best + deintctrl->SetDeinterlacePrefs(DeinterlacePref_NextBest);//Choose Next Best + + break; + case 3: //Bob + deintctrl->SetDeinterlacePrefs(DeinterlacePref_BOB);//Choose NBob + break; + case 4: //Weave + deintctrl->SetDeinterlacePrefs(DeinterlacePref_Weave);//Choose Weave + break; + }; + deintctrl->Release(); + /*VMR 9 stuff end */ IFilterGraph2*fg2=NULL; if (dsgraphbuilder->QueryInterface(IID_IFilterGraph2,(void**)&fg2)!= S_OK) diff --git a/videowin.h b/videowin.h index f35d02a..7bc868e 100644 --- a/videowin.h +++ b/videowin.h @@ -71,9 +71,6 @@ class VideoWin : public Video int setPosition(int x, int y); int sync(); int play(); - bool loadOptionsfromServer(VDR* vdr); - bool saveOptionstoServer(); - bool addOptionPagesToWTB(WTabBar *wtb); int dsplay(); bool InIframemode() {return iframemode;}; int stop(); @@ -94,11 +91,19 @@ class VideoWin : public Video ULLONG frameNumberToTimecode(ULONG framenumber); ULLONG getCurrentTimestamp(); + bool loadOptionsfromServer(VDR* vdr); + bool saveOptionstoServer(); + bool addOptionPagesToWTB(WTabBar *wtb); + bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane); + bool handleOptionChanges(Option* option); + //Writing Data to Videodevice virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos); virtual UINT DeliverMediaSample(const UCHAR* buffer, UINT *samplepos); UINT DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, UINT *samplepos); + + virtual bool supportsAc3(); @@ -185,6 +190,7 @@ private: int lastaudiomode; int audiovolume; UCHAR aud_type; + unsigned int vmrdeinterlacing; #ifdef DS_DEBUG DWORD graphidentifier; #endif diff --git a/vopts.cc b/vopts.cc index a1c71da..e7a3ad8 100644 --- a/vopts.cc +++ b/vopts.cc @@ -112,6 +112,10 @@ VOpts::VOpts() options.push_back(option); wop->addOptionLine(option); + Remote::getInstance()->addOptionsToPanes(0,&options,wop); + Video::getInstance()->addOptionsToPanes(0,&options,wop); + Audio::getInstance()->addOptionsToPanes(0,&options,wop); + /* WRemoteConfig* wrc = new WRemoteConfig(); tabbar.addTab(tr("Remote Control"), wrc);*/ @@ -139,6 +143,10 @@ VOpts::VOpts() options.push_back(option); wop->addOptionLine(option); + Remote::getInstance()->addOptionsToPanes(1,&options,wop); + Video::getInstance()->addOptionsToPanes(1,&options,wop); + Audio::getInstance()->addOptionsToPanes(1,&options,wop); + wop = new WOptionPane(); tabbar.addTab(tr("Advanced"), wop); @@ -153,6 +161,10 @@ VOpts::VOpts() option = new Option(14, "Use WSS (PAL only)", "General", "WSS", Option::TYPE_TEXT, 2, 0, 0, options14); options.push_back(option); wop->addOptionLine(option); + + Remote::getInstance()->addOptionsToPanes(2,&options,wop); + Video::getInstance()->addOptionsToPanes(2,&options,wop); + Audio::getInstance()->addOptionsToPanes(2,&options,wop); } VOpts::~VOpts() @@ -236,90 +248,94 @@ void VOpts::doSave() } // Set new setting - - switch(options[i]->id) + if (options[i]->opthandler == NULL) //Ok, noone else is handling this, we are doing it { - case 1: + switch(options[i]->id) { - if (options[i]->userSetChoice == 1) + case 1: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote"); - Remote::getInstance()->setRemoteType(Remote::NEWREMOTE); + if (options[i]->userSetChoice == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote"); + Remote::getInstance()->setRemoteType(Remote::NEWREMOTE); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting Old Remote"); + Remote::getInstance()->setRemoteType(Remote::OLDREMOTE); + } + break; } - else + case 2: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting Old Remote"); - Remote::getInstance()->setRemoteType(Remote::OLDREMOTE); + Message* m = new Message(); + m->message = Message::CHANGE_LANGUAGE; + m->to = Command::getInstance(); + Command::getInstance()->postMessageNoLock(m); + break; } - break; - } - case 2: - { - Message* m = new Message(); - m->message = Message::CHANGE_LANGUAGE; - m->to = Command::getInstance(); - Command::getInstance()->postMessageNoLock(m); - break; - } - case 3: - { - if (options[i]->userSetChoice == 1) + case 3: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video"); - Video::getInstance()->setConnection(Video::SVIDEO); + if (options[i]->userSetChoice == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video"); + Video::getInstance()->setConnection(Video::SVIDEO); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite"); + Video::getInstance()->setConnection(Video::COMPOSITERGB); + } + break; } - else + case 4: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite"); - Video::getInstance()->setConnection(Video::COMPOSITERGB); + if (options[i]->userSetChoice == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV"); + Video::getInstance()->setTVsize(Video::ASPECT16X9); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV"); + Video::getInstance()->setTVsize(Video::ASPECT4X3); + } + break; } - break; - } - case 4: - { - if (options[i]->userSetChoice == 1) + case 5: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV"); - Video::getInstance()->setTVsize(Video::ASPECT16X9); + if (options[i]->userSetChoice == 1) + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox"); + Video::getInstance()->setMode(Video::LETTERBOX); + } + else + { + Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides"); + Video::getInstance()->setMode(Video::NORMAL); + } + break; } - else + case 13: { - Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV"); - Video::getInstance()->setTVsize(Video::ASPECT4X3); + size_t newTCPsize = 2048; + if (options[i]->userSetChoice == 0) newTCPsize = 1024; + else if (options[i]->userSetChoice == 1) newTCPsize = 2048; + else if (options[i]->userSetChoice == 2) newTCPsize = 4096; + else if (options[i]->userSetChoice == 3) newTCPsize = 8192; + else if (options[i]->userSetChoice == 4) newTCPsize = 16384; + else if (options[i]->userSetChoice == 5) newTCPsize = 32768; + else if (options[i]->userSetChoice == 6) newTCPsize = 65536; + Log::getInstance()->log("Options", Log::DEBUG, "Setting TCP window size %i", newTCPsize); + VDR::getInstance()->setReceiveWindow(newTCPsize); + break; } - break; - } - case 5: - { - if (options[i]->userSetChoice == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox"); - Video::getInstance()->setMode(Video::LETTERBOX); - } - else - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides"); - Video::getInstance()->setMode(Video::NORMAL); - } - break; - } - case 13: - { - size_t newTCPsize = 2048; - - if (options[i]->userSetChoice == 0) newTCPsize = 1024; - else if (options[i]->userSetChoice == 1) newTCPsize = 2048; - else if (options[i]->userSetChoice == 2) newTCPsize = 4096; - else if (options[i]->userSetChoice == 3) newTCPsize = 8192; - else if (options[i]->userSetChoice == 4) newTCPsize = 16384; - else if (options[i]->userSetChoice == 5) newTCPsize = 32768; - else if (options[i]->userSetChoice == 6) newTCPsize = 65536; - - Log::getInstance()->log("Options", Log::DEBUG, "Setting TCP window size %i", newTCPsize); - VDR::getInstance()->setReceiveWindow(newTCPsize); - break; } } + else + { + options[i]->opthandler->handleOptionChanges(options[i]); + } } } @@ -329,8 +345,9 @@ void VOpts::processMessage(Message* m) { int x=(m->parameter>>16)-getScreenX(); int y=(m->parameter&0xFFFF)-getScreenY(); - if (tabbar.mouseMove(x,y)) { - BoxStack::getInstance()->update(this); + if (tabbar.mouseMove(x,y)) + { + BoxStack::getInstance()->update(this); } } @@ -338,14 +355,14 @@ void VOpts::processMessage(Message* m) { int x=(m->parameter>>16)-getScreenX(); int y=(m->parameter&0xFFFF)-getScreenY(); - if (tabbar.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->update(this); - } else if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) + if (tabbar.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + BoxStack::getInstance()->update(this); + } + else if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) + { + BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press } - - } } diff --git a/vopts.h b/vopts.h index 8cf95c3..4e31031 100644 --- a/vopts.h +++ b/vopts.h @@ -21,14 +21,15 @@ #ifndef VOPTS_H #define VOPTS_H -#include + #include "tbboxx.h" #include "defines.h" #include "wtabbar.h" #include "i18n.h" +#include "option.h" class Boxx; -class Option; + class VOpts : public TBBoxx { @@ -47,7 +48,7 @@ class VOpts : public TBBoxx int numPanes; Boxx** panes; - vector options; + Options options; const char** options2; // Language list names const char** options2keys; // Language list codes diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 99ea2e1..809890a 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -502,7 +502,7 @@ void VVideoLiveTV::doKey(int command) keyingInput[0] = command; keying++; - char keyingString[numberWidth+1]; + char* keyingString = new char[numberWidth + 1]; for (i = 0; i < numberWidth; i++) keyingString[i] = '_'; keyingString[numberWidth] = '\0'; @@ -534,6 +534,7 @@ void VVideoLiveTV::doKey(int command) boxstack->update(this, osd.getRegion()); Timers::getInstance()->setTimerD(this, 1, 3); // 3s for keying input } + delete[] keyingString; } void VVideoLiveTV::displayOSD() -- 2.39.2