Compare commits

...

6 Commits

Author SHA1 Message Date
Klaus Schmidinger
327b4c35ac Added missing 'const' to some cChannel member functions 2003-10-26 13:49:59 +01:00
Klaus Schmidinger
ccbebacc16 Fixed handling CAM menus in case the CAM connection fails while the menu is being presented 2003-10-26 13:30:36 +01:00
Klaus Schmidinger
d8a8e37988 Fixed handling comments in editing marks 2003-10-24 15:49:00 +02:00
Klaus Schmidinger
40a7b8505a Continuing learning remote control keys in case one rc fails 2003-10-24 15:48:00 +02:00
Klaus Schmidinger
514ee9e63a Improved cDvbDevice::StillPicture() (cont'd) 2003-10-24 14:32:38 +02:00
Klaus Schmidinger
262c266637 Improved cDvbDevice::StillPicture() 2003-10-19 11:43:07 +02:00
9 changed files with 84 additions and 33 deletions

View File

@ -641,6 +641,7 @@ Torsten Herz <torsten.herz@web.de>
to switch to an other channel to switch to an other channel
for reporting a wrong EPG bugfix code number for the MAX_USEFUL_SUBTITLE_LENGTH fix for reporting a wrong EPG bugfix code number for the MAX_USEFUL_SUBTITLE_LENGTH fix
for fixing a bug in resetting OSD color palettes for fixing a bug in resetting OSD color palettes
for adding missing 'const' to some cChannel member functions
Steffen Becker <stbecker@rbg.informatik.tu-darmstadt.de> Steffen Becker <stbecker@rbg.informatik.tu-darmstadt.de>
for reporting a problem with CPU load peaks (in the EPG scanner) for reporting a problem with CPU load peaks (in the EPG scanner)
@ -844,3 +845,7 @@ Markus Hardt <markus.hardt@gmx.net>
Thomas Rausch <Thomas.Rausch@gmx.de> Thomas Rausch <Thomas.Rausch@gmx.de>
for making VDR try to get a timer's channel without RID when loading 'timers.conf' for making VDR try to get a timer's channel without RID when loading 'timers.conf'
Thomas v. Keller <v.keller@neckarufer.de>
for reporting a crash in case the CAM connection fails while a CAM menu
is being presented

18
HISTORY
View File

@ -2433,3 +2433,21 @@ Video Disk Recorder Revision History
full (suggested by Emil Naepflein). full (suggested by Emil Naepflein).
- Channel IDs are now checked when reading 'channels.conf' to avoid later - Channel IDs are now checked when reading 'channels.conf' to avoid later
problems with timers. problems with timers.
2003-10-19: Version 1.2.6pre2
- Improved cDvbDevice::StillPicture() (thanks to Thomas Heiligenmann).
2003-10-24: Version 1.2.6pre3
- Improved cDvbDevice::StillPicture() (thanks to Oliver Endriss).
- Continuing learning remote control keys in case one rc fails (thanks to
Oliver Endriss).
- Fixed handling comments in editing marks.
2003-10-26: Version 1.2.6pre4
- Fixed handling CAM menus in case the CAM connection fails while the menu
is being presented (thanks to Thomas v. Keller for reportign this one).
- Added missing 'const' to some cChannel member functions (thanks to Torsten
Herz).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: channels.h 1.8 2003/08/16 09:12:15 kls Exp $ * $Id: channels.h 1.8.1.1 2003/10/26 13:32:00 kls Exp $
*/ */
#ifndef __CHANNELS_H #ifndef __CHANNELS_H
@ -119,9 +119,9 @@ public:
int Transmission(void) const { return transmission; } int Transmission(void) const { return transmission; }
int Guard(void) const { return guard; } int Guard(void) const { return guard; }
int Hierarchy(void) const { return hierarchy; } int Hierarchy(void) const { return hierarchy; }
bool IsCable(void) { return (source & cSource::st_Mask) == cSource::stCable; } bool IsCable(void) const { return (source & cSource::st_Mask) == cSource::stCable; }
bool IsSat(void) { return (source & cSource::st_Mask) == cSource::stSat; } bool IsSat(void) const { return (source & cSource::st_Mask) == cSource::stSat; }
bool IsTerr(void) { return (source & cSource::st_Mask) == cSource::stTerr; } bool IsTerr(void) const { return (source & cSource::st_Mask) == cSource::stTerr; }
tChannelID GetChannelID(void) const; tChannelID GetChannelID(void) const;
}; };

54
ci.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: ci.c 1.16 2003/08/02 10:00:01 kls Exp $ * $Id: ci.c 1.16.1.1 2003/10/26 13:04:23 kls Exp $
*/ */
/* XXX TODO /* XXX TODO
@ -1004,15 +1004,15 @@ bool cCiDateTime::Process(int Length, const uint8_t *Data)
class cCiMMI : public cCiSession { class cCiMMI : public cCiSession {
private: private:
char *GetText(int &Length, const uint8_t **Data); char *GetText(int &Length, const uint8_t **Data);
cCiMenu *menu; cCiMenu *menu, *fetchedMenu;
cCiEnquiry *enquiry; cCiEnquiry *enquiry, *fetchedEnquiry;
public: public:
cCiMMI(int SessionId, cCiTransportConnection *Tc); cCiMMI(int SessionId, cCiTransportConnection *Tc);
virtual ~cCiMMI(); virtual ~cCiMMI();
virtual bool Process(int Length = 0, const uint8_t *Data = NULL); virtual bool Process(int Length = 0, const uint8_t *Data = NULL);
virtual bool HasUserIO(void) { return menu || enquiry; } virtual bool HasUserIO(void) { return menu || enquiry; }
cCiMenu *Menu(void); cCiMenu *Menu(bool Clear = false);
cCiEnquiry *Enquiry(void); cCiEnquiry *Enquiry(bool Clear = false);
bool SendMenuAnswer(uint8_t Selection); bool SendMenuAnswer(uint8_t Selection);
bool SendAnswer(const char *Text); bool SendAnswer(const char *Text);
}; };
@ -1021,13 +1021,21 @@ cCiMMI::cCiMMI(int SessionId, cCiTransportConnection *Tc)
:cCiSession(SessionId, RI_MMI, Tc) :cCiSession(SessionId, RI_MMI, Tc)
{ {
dbgprotocol("New MMI (session id %d)\n", SessionId); dbgprotocol("New MMI (session id %d)\n", SessionId);
menu = NULL; menu = fetchedMenu = NULL;
enquiry = NULL; enquiry = fetchedEnquiry = NULL;
} }
cCiMMI::~cCiMMI() cCiMMI::~cCiMMI()
{ {
if (fetchedMenu) {
cMutexLock MutexLock(&fetchedMenu->mutex);
fetchedMenu->mmi = NULL;
}
delete menu; delete menu;
if (fetchedEnquiry) {
cMutexLock MutexLock(&fetchedEnquiry->mutex);
fetchedEnquiry->mmi = NULL;
}
delete enquiry; delete enquiry;
} }
@ -1123,18 +1131,26 @@ bool cCiMMI::Process(int Length, const uint8_t *Data)
return true; return true;
} }
cCiMenu *cCiMMI::Menu(void) cCiMenu *cCiMMI::Menu(bool Clear)
{ {
cCiMenu *m = menu; if (Clear)
menu = NULL; fetchedMenu = NULL;
return m; else if (menu) {
fetchedMenu = menu;
menu = NULL;
}
return fetchedMenu;
} }
cCiEnquiry *cCiMMI::Enquiry(void) cCiEnquiry *cCiMMI::Enquiry(bool Clear)
{ {
cCiEnquiry *e = enquiry; if (Clear)
enquiry = NULL; fetchedEnquiry = NULL;
return e; else if (enquiry) {
fetchedEnquiry = enquiry;
enquiry = NULL;
}
return fetchedEnquiry;
} }
bool cCiMMI::SendMenuAnswer(uint8_t Selection) bool cCiMMI::SendMenuAnswer(uint8_t Selection)
@ -1170,6 +1186,9 @@ cCiMenu::cCiMenu(cCiMMI *MMI, bool Selectable)
cCiMenu::~cCiMenu() cCiMenu::~cCiMenu()
{ {
cMutexLock MutexLock(&mutex);
if (mmi)
mmi->Menu(true);
free(titleText); free(titleText);
free(subTitleText); free(subTitleText);
free(bottomText); free(bottomText);
@ -1188,6 +1207,7 @@ bool cCiMenu::AddEntry(char *s)
bool cCiMenu::Select(int Index) bool cCiMenu::Select(int Index)
{ {
cMutexLock MutexLock(&mutex);
if (mmi && -1 <= Index && Index < numEntries) if (mmi && -1 <= Index && Index < numEntries)
return mmi->SendMenuAnswer(Index + 1); return mmi->SendMenuAnswer(Index + 1);
return false; return false;
@ -1210,11 +1230,15 @@ cCiEnquiry::cCiEnquiry(cCiMMI *MMI)
cCiEnquiry::~cCiEnquiry() cCiEnquiry::~cCiEnquiry()
{ {
cMutexLock MutexLock(&mutex);
if (mmi)
mmi->Enquiry(true);
free(text); free(text);
} }
bool cCiEnquiry::Reply(const char *s) bool cCiEnquiry::Reply(const char *s)
{ {
cMutexLock MutexLock(&mutex);
return mmi ? mmi->SendAnswer(s) : false; return mmi ? mmi->SendAnswer(s) : false;
} }

4
ci.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: ci.h 1.8 2003/05/25 11:44:47 kls Exp $ * $Id: ci.h 1.8.1.1 2003/10/26 12:22:09 kls Exp $
*/ */
#ifndef __CI_H #ifndef __CI_H
@ -21,6 +21,7 @@ class cCiMenu {
private: private:
enum { MAX_CIMENU_ENTRIES = 64 }; ///< XXX is there a specified maximum? enum { MAX_CIMENU_ENTRIES = 64 }; ///< XXX is there a specified maximum?
cCiMMI *mmi; cCiMMI *mmi;
cMutex mutex;
bool selectable; bool selectable;
char *titleText; char *titleText;
char *subTitleText; char *subTitleText;
@ -45,6 +46,7 @@ class cCiEnquiry {
friend class cCiMMI; friend class cCiMMI;
private: private:
cCiMMI *mmi; cCiMMI *mmi;
cMutex mutex;
char *text; char *text;
bool blind; bool blind;
int expectedLength; int expectedLength;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 1.176 2003/10/17 12:35:23 kls Exp $ * $Id: config.h 1.176.1.3 2003/10/26 13:30:36 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "device.h" #include "device.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.2.6pre1" #define VDRVERSION "1.2.6pre4"
#define VDRVERSNUM 10206 // Version * 10000 + Major * 100 + Minor #define VDRVERSNUM 10206 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99 #define MAXPRIORITY 99

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.c 1.67 2003/10/17 15:36:13 kls Exp $ * $Id: dvbdevice.c 1.67.1.2 2003/10/24 14:32:20 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -957,10 +957,14 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
// skip header extension // skip header extension
if ((Data[i + 6] & 0xC0) == 0x80) { if ((Data[i + 6] & 0xC0) == 0x80) {
// MPEG-2 PES header // MPEG-2 PES header
if (Data[i + 8] >= Length)
break;
offs += 3; offs += 3;
offs += Data[i + 8]; offs += Data[i + 8];
len -= 3; len -= 3;
len -= Data[i + 8]; len -= Data[i + 8];
if (len < 0 || offs + len > Length)
break;
} }
else { else {
// MPEG-1 PES header // MPEG-1 PES header
@ -968,19 +972,19 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
offs++; offs++;
len--; len--;
} }
if ((Data[offs] & 0xC0) == 0x40) { if (offs <= Length - 2 && len >= 2 && (Data[offs] & 0xC0) == 0x40) {
offs += 2; offs += 2;
len -= 2; len -= 2;
} }
if ((Data[offs] & 0xF0) == 0x20) { if (offs <= Length - 5 && len >= 5 && (Data[offs] & 0xF0) == 0x20) {
offs += 5; offs += 5;
len -= 5; len -= 5;
} }
else if ((Data[offs] & 0xF0) == 0x30) { else if (offs <= Length - 10 && len >= 10 && (Data[offs] & 0xF0) == 0x30) {
offs += 10; offs += 10;
len -= 10; len -= 10;
} }
else if (Data[offs] == 0x0F) { else if (offs < Length && len > 0) {
offs++; offs++;
len--; len--;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: interface.c 1.65 2003/10/05 09:48:13 kls Exp $ * $Id: interface.c 1.65.1.1 2003/10/24 15:48:00 kls Exp $
*/ */
#include "interface.h" #include "interface.h"
@ -433,7 +433,7 @@ void cInterface::LearnKeys(void)
Clear(); Clear();
if (!rc) { if (!rc) {
Close(); Close();
return; continue;
} }
WriteText(1, 1, Headline); WriteText(1, 1, Headline);
WriteText(1, 3, tr("Phase 3: Saving key codes")); WriteText(1, 3, tr("Phase 3: Saving key codes"));

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.84 2003/10/17 14:36:58 kls Exp $ * $Id: recording.c 1.84.1.1 2003/10/24 15:49:00 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -681,10 +681,8 @@ bool cMark::Parse(const char *s)
const char *p = strchr(s, ' '); const char *p = strchr(s, ' ');
if (p) { if (p) {
p = skipspace(p); p = skipspace(p);
if (*p) { if (*p)
comment = strdup(p); comment = strdup(p);
comment[strlen(comment) - 1] = 0; // strips trailing newline
}
} }
return true; return true;
} }