summaryrefslogtreecommitdiff
path: root/dvbsubtitle.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-09-06 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-09-06 18:00:00 +0200
commitc848ab793a302dc067663ec4a06395745e443c9d (patch)
treea6c65facbf68864b9523152560a4ae23a6ad2f16 /dvbsubtitle.c
parent771986b89fc19b4ae65179ccf7dd8082512f8b7d (diff)
downloadvdr-patch-lnbsharing-c848ab793a302dc067663ec4a06395745e443c9d.tar.gz
vdr-patch-lnbsharing-c848ab793a302dc067663ec4a06395745e443c9d.tar.bz2
Version 1.7.1vdr-1.7.1
- Adapted the tuning code to the new DVBFE_SET_DELSYS API (thanks to Reinhard Nissl). VDR now uses the driver from http://jusst.de/hg/multiproto_plus. - Updated the Italian OSD texts (thanks to Diego Pierotto). - Removed obsolete $(NCURSESLIB) from the Makefile. - Implemented handling the standard component descriptor for AC3 (stream=4), as it will soon be used by the German ARD channels (thanks to Michael Pennewiß for advance information about this change). The previously used "Premiere pseudo standard" (stream=2, type=5) still works, but has apparently been wrongfully used by broadcasters from the beginning. - Added missing description of the 'S' channel parameter to vdr.5 (reported by Reinhard Nissl). - The SVDRP signon message now indicates the character encoding in use, as in "220 video SVDRP VideoDiskRecorder 1.7.1; Fri May 2 16:17:10 2008; ISO-8859-1". This may be useful for instance for external tools that provide EPG data, so that they can correctly encode the strings. - No longer calling FcFini() to avoid problems with older (broken) versions of fontconfig (suggested by Edgar Toernig). - Removed the compile time option VFAT to allow users of precompiled binary distributions to have full control over whether or not to use the --vfat option at runtime (suggested by Michael Nork). - First step towards switching to TS (Transport Stream) as recording format: + The new function cDevice::PlayTs() is used to play TS packets. + The new functions cDevice::PlayTsVideo() and cDevice::PlayTsAudio() are used to play video and audio TS packets, respectively. + The new function cAudio::PlayTs() is used to play audio TS packets. + The new class cPatPmtGenerator is used to generate a PAT/PMT pair that precedes the TS data in Transfer Mode. + The new class cPatPmtParser is used by cDevice to parse the PAT/PMT data in a TS in order to find out which streams it contains. + The new class cTsToPes is used to convert TS packets to a PES packet. + cTransfer no longer uses cRemux, and doesn't run a separate thread any more. It just generates a PAT/PMT and sends all received TS packets to the primary device's PlayTs(). + Live subtitle display no longer uses a ring buffer and separate thread. + cPesAssembler has been removed. Old VDR recordings only contain complete PES packets. + Since a TS needs to have a PAT/PMT, which requires the video stream type to be explicitly given, the format of the VPID field in the channels.conf file and the SVDRP commands NEWC/MODC/LSTC has been extended. The video stream type now follows the VPID and optional PPID, separated by an '=' sign. - Updated the sources.conf file (thanks to Oleg Roitburd). - Fixed a possible integer overflow in GetAbsTime() (thanks to Alexander Rieger). - Fixed a problem with calling isyslog() from within the SignalHandler() (thanks to Udo Richter). - Replaced the Finnish language code "smi" with "suo" (thanks to Rolf Ahrenberg). - Fixed wrong value for TableIdBAT in libsi/si.h (thanks to Winfried Köhler). - Errors in config files no longer keep VDR from starting. - Removed unneeded include files <linux/dvb/dmx.h> und <time.h> from remux.h (reported by Tobias Grimm).
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r--dvbsubtitle.c62
1 files changed, 45 insertions, 17 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index 10d76b5..69dc6fa 100644
--- a/dvbsubtitle.c
+++ b/dvbsubtitle.c
@@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
- * $Id: dvbsubtitle.c 2.0 2007/11/25 13:33:08 kls Exp $
+ * $Id: dvbsubtitle.c 2.1 2008/05/25 14:36:24 kls Exp $
*/
#include "dvbsubtitle.h"
@@ -580,12 +580,12 @@ bool cDvbSubtitleAssembler::Realloc(int Size)
unsigned char *cDvbSubtitleAssembler::Get(int &Length)
{
if (length > pos + 5) {
- Length = (data[pos + 4] << 8) + data[pos + 5] + 6;
- if (length >= pos + Length) {
- unsigned char *result = data + pos;
- pos += Length;
- return result;
- }
+ Length = (data[pos + 4] << 8) + data[pos + 5] + 6;
+ if (length >= pos + Length) {
+ unsigned char *result = data + pos;
+ pos += Length;
+ return result;
+ }
}
return NULL;
}
@@ -684,10 +684,10 @@ void cDvbSubtitleConverter::Reset(void)
Unlock();
}
-int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
+int cDvbSubtitleConverter::ConvertFragments(const uchar *Data, int Length)
{
if (Data && Length > 8) {
- int PayloadOffset = Data[8] + 9;
+ int PayloadOffset = PesPayloadOffset(Data);
int SubstreamHeaderLength = 4;
bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00;
@@ -699,15 +699,9 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
}
if (Length > PayloadOffset + SubstreamHeaderLength) {
- int64_t pts = 0;
- if ((Data[7] & 0x80) && Data[8] >= 5) {
- pts = (((int64_t)Data[ 9]) & 0x0E) << 29;
- pts |= ( (int64_t)Data[10]) << 22;
- pts |= (((int64_t)Data[11]) & 0xFE) << 14;
- pts |= ( (int64_t)Data[12]) << 7;
- pts |= (((int64_t)Data[13]) & 0xFE) >> 1;
+ int64_t pts = PesGetPts(Data);
+ if (pts)
dbgconverter("Converter PTS: %lld\n", pts);
- }
const uchar *data = Data + PayloadOffset + SubstreamHeaderLength; // skip substream header
int length = Length - PayloadOffset - SubstreamHeaderLength; // skip substream header
if (ResetSubtitleAssembler)
@@ -736,6 +730,40 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
return 0;
}
+int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
+{
+ if (Data && Length > 8) {
+ int PayloadOffset = PesPayloadOffset(Data);
+ if (Length > PayloadOffset) {
+ int64_t pts = PesGetPts(Data);
+ if (pts)
+ dbgconverter("Converter PTS: %lld\n", pts);
+ const uchar *data = Data + PayloadOffset;
+ int length = Length - PayloadOffset;
+ if (length > 3) {
+ if (data[0] == 0x20 && data[1] == 0x00 && data[2] == 0x0F) {
+ data += 2;
+ length -= 2;
+ }
+ const uchar *b = data;
+ while (length > 0) {
+ if (b[0] == 0x0F) {
+ int n = ExtractSegment(b, length, pts);
+ if (n < 0)
+ break;
+ b += n;
+ length -= n;
+ }
+ else
+ break;
+ }
+ }
+ }
+ return Length;
+ }
+ return 0;
+}
+
#define LimitTo32Bit(n) (n & 0x00000000FFFFFFFFL)
#define MAXDELTA 40000 // max. reasonable PTS/STC delta in ms