From 630ba21dc198e3fbf8c15c59f7ea852f7174c476 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 21 Nov 2004 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.17=20-=20Fixed=20cRemux::ScanVideoPacket(?= =?UTF-8?q?)=20to=20make=20sure=20it=20doesn't=20access=20memory=20beyond?= =?UTF-8?q?=20=20=20the=20end=20of=20the=20given=20buffer,=20which=20has?= =?UTF-8?q?=20caused=20some=20unjustified=20"unknown=20=20=20picture=20typ?= =?UTF-8?q?e=20errors"=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-?= =?UTF-8?q?=20Fixed=20a=20possible=20crash=20when=20pausing=20live=20video?= =?UTF-8?q?=20and=20the=20recording=20was=20unable=20=20=20to=20start,=20m?= =?UTF-8?q?aybe=20because=20there=20was=20no=20lock=20on=20the=20device=20?= =?UTF-8?q?(thanks=20to=20Andreas=20=20=20Brugger=20for=20reporting=20this?= =?UTF-8?q?=20one).=20-=20Fixed=20some=20characters=20in=20the=20iso8859-2?= =?UTF-8?q?=20font=20file=20(thanks=20to=20Dino=20Ravnic).=20-=20Fixed=20s?= =?UTF-8?q?ome=20errors=20in=20the=20Croatian=20language=20texts=20(thanks?= =?UTF-8?q?=20to=20Dino=20Ravnic).=20-=20Fixed=20a=20possible=20recursion?= =?UTF-8?q?=20in=20cControl::Shutdown()=20(thanks=20to=20Sascha=20Volkenan?= =?UTF-8?q?dt).=20-=20Now=20setting=20the=20VPID=20before=20the=20APID=20i?= =?UTF-8?q?n=20live=20mode=20to=20avoid=20unnecessary=20=20=20overhead=20i?= =?UTF-8?q?n=20the=20firmware=20(thanks=20to=20Werner=20Fink).=20-=20Now?= =?UTF-8?q?=20checking=20available=20OSD=20memory=20at=20runtime=20(thanks?= =?UTF-8?q?=20to=20Oliver=20Endriss).=20-=20Fixed=20some=20typos=20in=20th?= =?UTF-8?q?e=20Makefile's=20'font'=20target=20(thanks=20to=20Olaf=20Titz).?= =?UTF-8?q?=20-=20Fixed=20handling=20childTid=20in=20cThread=20to=20avoid?= =?UTF-8?q?=20possible=20race=20conditions=20(thanks=20=20=20to=20Stefan?= =?UTF-8?q?=20Huelswitt=20for=20pointing=20this=20out).=20-=20Fixed=20togg?= =?UTF-8?q?ling=20the=20"Day"=20item=20in=20the=20"Timers"=20menu,=20so=20?= =?UTF-8?q?that=20it=20selects=20the=20=20=20right=20day=20of=20week=20for?= =?UTF-8?q?=20timers=20in=20the=20future.=20-=20Some=20improvements=20to?= =?UTF-8?q?=20cPoller=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbosd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'dvbosd.c') diff --git a/dvbosd.c b/dvbosd.c index 973298d..fbf6f61 100644 --- a/dvbosd.c +++ b/dvbosd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.c 1.24 2004/07/18 13:51:42 kls Exp $ + * $Id: dvbosd.c 1.25 2004/11/20 14:29:25 kls Exp $ */ #include "dvbosd.h" @@ -18,11 +18,12 @@ // --- cDvbOsd --------------------------------------------------------------- #define MAXNUMWINDOWS 7 // OSD windows are counted 1...7 -#define MAXOSDMEMORY 92000 // number of bytes available to the OSD (depends on firmware version, but there is no way of determining the actual value) +#define MAXOSDMEMORY 92000 // number of bytes available to the OSD (for unmodified DVB cards) class cDvbOsd : public cOsd { private: int osdDev; + int osdMem; bool shown; void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL); public: @@ -40,6 +41,14 @@ cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev) if (osdDev < 0) esyslog("ERROR: illegal OSD device handle (%d)!", osdDev); else { + osdMem = MAXOSDMEMORY; +#ifdef OSD_CAP_MEMSIZE + // modified DVB cards may have more OSD memory: + osd_cap_t cap; + cap.cmd = OSD_CAP_MEMSIZE; + if (ioctl(osdDev, OSD_GET_CAPABILITY, &cap) == 0) + osdMem = cap.val; +#endif // must clear all windows here to avoid flashing effects - doesn't work if done // in Flush() only for the windows that are actually used... for (int i = 0; i < MAXNUMWINDOWS; i++) { @@ -74,7 +83,7 @@ eOsdError cDvbOsd::CanHandleAreas(const tArea *Areas, int NumAreas) return oeWrongAlignment; TotalMemory += Areas[i].Width() * Areas[i].Height() / (8 / Areas[i].bpp); } - if (TotalMemory > MAXOSDMEMORY) + if (TotalMemory > osdMem) return oeOutOfMemory; } return Result; -- cgit v1.2.3