summaryrefslogtreecommitdiff
path: root/libsi/util.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-02-19 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-02-19 18:00:00 +0100
commitb9bfba20f25a0562d22bb57d611abc3918e1c147 (patch)
treed90e74c79c6c30be55a9fd8c734aabdee1660a9c /libsi/util.h
parentc23992b807aca1cea08193b773f80eee0cb8f829 (diff)
downloadvdr-patch-lnbsharing-b9bfba20f25a0562d22bb57d611abc3918e1c147.tar.gz
vdr-patch-lnbsharing-b9bfba20f25a0562d22bb57d611abc3918e1c147.tar.bz2
Version 1.3.43vdr-1.3.43
- Removed an unnecessary toFile->SetReadAhead() from cutter.c (thanks to Artur Skawina). - The "Back" key now restores the original string when pressed while editing a string item (suggested by Markus Hahn). - Now stopping scanning the video directory if there are too many levels of symbolic links, which might indicate a recursive link loop (based on a patch from Helmut Auer). - Improved OSD area handling in cDvbSpuDecoder (thanks to Marco Schlüßler). - Now logging the description (if present) in case a thread is canceled (suggested by Marco Schlüßler). - cMenuText now uses the given font (thanks to Rolf Ahrenberg). - The ST:TNG skin now uses the fixed font if requested when displaying texts. - Fixed some typos in the CONTRIBUTORS file (thanks to Frank Krömmelbein). - Changed offset and size handling in 'libsi' from 'unsigned' to 'signed', so that overflows can be better detected (thanks to Marcel Wiesweg). - Checking data size in CaDescriptor::Parse() and LinkageDescriptor::Parse() of 'libsi' to avoid crashes with invalid data (thanks to Marcel Wiesweg). - Made CharArray::DataOwnData::assign() in 'libsi' more robust against invalid data (suggested by Oliver Endriss). Also changed CharArray::DataOwnData::Delete() so that it sets 'size' and 'data' to 0. - Now resetting the channel number if the number entered through the numeric keys exceeds the maximum channel number (thanks to Rolf Ahrenberg). - The language code in the 'X' component records of EPG data can now consist of two codes, separated by '+'. - If a recording starts and there is no EPG data available for the recorded channel, the 'X' audio component records for the 'info.vdr' file are now generated from the channel's PID data. - Externally provided EPG data (with table ID 0x00) now gets its component descriptors set from the broadcast data, so that language codes and descriptions are available (suggested by Andreas Brugger). - When setting the audio track descriptions, the language codes are now also set in case this is a replay session (based on a patch from Rolf Ahrenberg). - If a recording starts and the channel's audio PID data has more language code information than the EPG's component data, the code from the channel is taken. - Fixed handling DPID when deciding whether to switch to 'Transfer Mode' (thanks to Marco Schlüßler). - Fixed replaying recordings of radio channels with many audio tracks (thanks to Reinhard Nissl). - Added a comment to tChannelID::nid, explaining that is is actually the "original" network id.
Diffstat (limited to 'libsi/util.h')
-rw-r--r--libsi/util.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/libsi/util.h b/libsi/util.h
index da188ad..91a4c32 100644
--- a/libsi/util.h
+++ b/libsi/util.h
@@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: util.h 1.5 2004/10/23 14:22:40 kls Exp $
+ * $Id: util.h 1.6 2006/02/18 10:38:20 kls Exp $
* *
***************************************************************************/
@@ -37,14 +37,14 @@ public:
~CharArray();
//can be called exactly once
- void assign(const unsigned char*data, unsigned int size, bool doCopy=true);
+ void assign(const unsigned char*data, int size, bool doCopy=true);
//compares to a null-terminated string
bool operator==(const char *string) const;
//compares to another CharArray (data not necessarily null-terminated)
bool operator==(const CharArray &other) const;
//returns another CharArray with its offset incremented by offset
- CharArray operator+(const unsigned int offset) const;
+ CharArray operator+(const int offset) const;
//access and convenience methods
const unsigned char* getData() const { return data_->data+off; }
@@ -52,28 +52,28 @@ public:
template <typename T> const T* getData() const { return (T*)(data_->data+off); }
template <typename T> const T* getData(int offset) const { return (T*)(data_->data+offset+off); }
//sets p to point to data+offset, increments offset
- template <typename T> void setPointerAndOffset(const T* &p, unsigned int &offset) const { p=(T*)getData(offset); offset+=sizeof(T); }
- unsigned char operator[](const unsigned int index) const { return data_->data ? data_->data[off+index] : 0; }
+ template <typename T> void setPointerAndOffset(const T* &p, int &offset) const { p=(T*)getData(offset); offset+=sizeof(T); }
+ unsigned char operator[](const int index) const { return data_->data ? data_->data[off+index] : 0; }
int getLength() const { return data_->size; }
- u_int16_t TwoBytes(const unsigned int index) const { return data_->data ? data_->TwoBytes(off+index) : 0; }
- u_int32_t FourBytes(const unsigned int index) const { return data_->data ? data_->FourBytes(off+index) : 0; }
+ u_int16_t TwoBytes(const int index) const { return data_->data ? data_->TwoBytes(off+index) : 0; }
+ u_int32_t FourBytes(const int index) const { return data_->data ? data_->FourBytes(off+index) : 0; }
bool isValid() const { return data_->valid; }
- bool checkSize(unsigned int offset) { return (data_->valid && (data_->valid=(off+offset < data_->size))); }
+ bool checkSize(int offset) { return (data_->valid && offset>=0 && (data_->valid=(off+offset < data_->size))); }
- void addOffset(unsigned int offset) { off+=offset; }
+ void addOffset(int offset) { off+=offset; }
private:
class Data {
public:
Data();
virtual ~Data();
- virtual void assign(const unsigned char*data, unsigned int size) = 0;
+ virtual void assign(const unsigned char*data, int size) = 0;
virtual void Delete() = 0;
- u_int16_t TwoBytes(const unsigned int index) const
+ u_int16_t TwoBytes(const int index) const
{ return (data[index] << 8) | data[index+1]; }
- u_int32_t FourBytes(const unsigned int index) const
+ u_int32_t FourBytes(const int index) const
{ return (data[index] << 24) | (data[index+1] << 16) | (data[index+2] << 8) | data[index+3]; }
/*#ifdef CHARARRAY_THREADSAFE
void Lock();
@@ -83,11 +83,11 @@ private:
void Unlock() {}
#endif
Data(const Data& d);
- void assign(unsigned int size);
+ void assign(int size);
*/
const unsigned char*data;
- unsigned int size;
+ int size;
// count_ is the number of CharArray objects that point at this
// count_ must be initialized to 1 by all constructors
@@ -106,18 +106,18 @@ private:
public:
DataOwnData() {}
virtual ~DataOwnData();
- virtual void assign(const unsigned char*data, unsigned int size);
+ virtual void assign(const unsigned char*data, int size);
virtual void Delete();
};
class DataForeignData : public Data {
public:
DataForeignData() {}
virtual ~DataForeignData();
- virtual void assign(const unsigned char*data, unsigned int size);
+ virtual void assign(const unsigned char*data, int size);
virtual void Delete();
};
Data* data_;
- unsigned int off;
+ int off;
};