diff options
author | Tobias Grimm <tobias@e-tobi.loc> | 2008-12-13 11:01:34 +0100 |
---|---|---|
committer | Tobias Grimm <tobias@e-tobi.loc> | 2008-12-13 11:01:34 +0100 |
commit | e5d1aacca2020e63dbaf320ba8b1de61746ad410 (patch) | |
tree | 0e267f716f34700a439971926fdc79b0172a0f38 /ttxtsubsrecorder.c | |
parent | 88012c106b8310507e872c72544f423433bac5d2 (diff) | |
download | vdr-plugin-ttxtsubs-0.0.5pre1.tar.gz vdr-plugin-ttxtsubs-0.0.5pre1.tar.bz2 |
- New features:v0.0.5pre1
- More than one language can be chosen, they are used in order of preference
- Handles languages with two ISO 639-2 identifiers (as ger/deu, fre/fra)
- Subtitles can now be turned on or off
- Optional main menu alternative for easy access
- Selectable vertical position of text for 4:3/Anamorphic or Letterbox
- Left, Center or Right horizontal position of text
- Remapping option for those French channels that incorrectly
sends teletext page numbers in decimal instead of hexadecimal.
Very moderate remapping done at the moment, I hope it is enough.
- Subtitles are now recorded with their PTS (timestamps). Not that
the timestamps are completely wrong on some channels, this
may confuse uncareful subtitle extracting software.
- Included patch for VDR 1.3.5 - untested!
- Bugs fixed:
- Fixed a net-to-host-order bug in the si parser that could make it
incorrectly think that there are no subtitles on a channel.
Thanks to Nicolas "tarass"!
- Fixed a bit swapping bug causing incorrect character encoding for
some languages. Thanks to Nicolas "tarass"!
Diffstat (limited to 'ttxtsubsrecorder.c')
-rw-r--r-- | ttxtsubsrecorder.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ttxtsubsrecorder.c b/ttxtsubsrecorder.c index 7cfb5c0..e31ec67 100644 --- a/ttxtsubsrecorder.c +++ b/ttxtsubsrecorder.c @@ -19,7 +19,7 @@ // ----- cTtxtSubsRecorder ----- -cTtxtSubsRecorder::cTtxtSubsRecorder(cDevice *dev, const cChannel *ch, char *lang, int HI) +cTtxtSubsRecorder::cTtxtSubsRecorder(cDevice *dev, const cChannel *ch) : mDev(dev), mSid(ch->Sid()), @@ -35,7 +35,7 @@ cTtxtSubsRecorder::cTtxtSubsRecorder(cDevice *dev, const cChannel *ch, char *lan if(GetTtxtInfo(dev->CardIndex(), ch->Number(), ch->Sid(), ch->Vpid(), mTtxtinfo)) { fprintf(stderr, "cTtxtSubsRecorder::cTtxtSubsRecorder: GetTtxtSubtitleInfo error!\n"); } else { - pi = FindSubs(mTtxtinfo, lang, HI, &pid, &page); + pi = FindSubs(mTtxtinfo, &pid, &page); if(!pi && mTtxtinfo->pidcount > 0) { pi = &(mTtxtinfo->p[0]); @@ -73,6 +73,7 @@ uint8_t *cTtxtSubsRecorder::GetPacket(uint8_t **outbuf, size_t *lenp) size_t len; uint8_t *b = (uint8_t *) mPacketBuffer; uint8_t line[46]; + encodedPTS pts; *outbuf = NULL; @@ -81,7 +82,7 @@ uint8_t *cTtxtSubsRecorder::GetPacket(uint8_t **outbuf, size_t *lenp) len = 46; // skip PES header area - if(mReceiver->Get(line)) { + if(mReceiver->Get(line, &pts)) { // if first line is a Y0, insert an index page // XXX This isn't really correct, we don't know if there is parallel magazine // transmission and a page in the index pages' mag is in progress... @@ -133,11 +134,23 @@ uint8_t *cTtxtSubsRecorder::GetPacket(uint8_t **outbuf, size_t *lenp) 0x00, 0x00, // len 0x80, // 10 and flags 0x00, // PTS_DTS_flags and other flags - 0x24}; // PES_header_data_length + 0x24, // PES_header_data_length + 0xff, 0xff, 0xff, 0xff, 0xff}; // PTS memcpy((char *) b, (char *) header, sizeof(header)); b[4] = (len-6) >> 8; b[5] = (len-6) & 0xff; +#define TEST_RECORD_PTS 1 +#if TEST_RECORD_PTS + if(pts.valid) { + b[7] |= 0x80; + b[9] = pts.data[0]; + b[10] = pts.data[1]; + b[11] = pts.data[2]; + b[12] = pts.data[3]; + b[13] = pts.data[4]; + } +#endif memset((char *) b + sizeof(header), 0xff, 45 - sizeof(header)); // add stuffing bytes b[45] = 0x1f; // EBU data, our payload type to indicate we have filtered data |