diff options
author | Tobias Grimm <tobias@e-tobi.loc> | 2009-04-26 16:49:31 +0200 |
---|---|---|
committer | Tobias Grimm <tobias@e-tobi.loc> | 2009-06-20 18:17:43 +0200 |
commit | 05538ee80faf6df4739fffb93e773cd8d6348d26 (patch) | |
tree | 40351cff9f857b77355827bf2fdd4cd49e5bf15f | |
parent | 135f859d562e74537e3ea0cd46148ff17e033168 (diff) | |
download | vdr-patches-patches/ttxtsubs-vdr-1.7.8.tar.gz vdr-patches-patches/ttxtsubs-vdr-1.7.8.tar.bz2 |
ttxtsubs: Dropped StripExtendedPackage and moved teletext subtitle processing into PlayPesPacket()patches/ttxtsubs-vdr-1.7.8
-rw-r--r-- | device.c | 7 | ||||
-rw-r--r-- | dvbplayer.c | 31 |
2 files changed, 8 insertions, 30 deletions
@@ -1183,6 +1183,13 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) } break; case 0xBD: { // private stream 1 + // EBU Teletext data, ETSI EN 300 472 + // if PES data header length = 24 and data_identifier = 0x10..0x1F (EBU Data) + if (Data[8] == 0x24 && Data[45] >= 0x10 && Data[45] < 0x20) { + cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData((uint8_t*)Data, Length); + break; + } + int PayloadOffset = Data[8] + 9; // Compatibility mode for old subtitles plugin: diff --git a/dvbplayer.c b/dvbplayer.c index 95c0cd8..9f96462 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -15,33 +15,6 @@ #include "ringbuffer.h" #include "thread.h" #include "tools.h" -#include "vdrttxtsubshooks.h" - -static void StripExtendedPackets(uchar *b, int Length) -{ - for (int i = 0; i < Length - 6; i++) { - if (b[i] == 0x00 && b[i + 1] == 0x00 && b[i + 2] == 0x01) { - uchar c = b[i + 3]; - int l = b[i + 4] * 256 + b[i + 5] + 6; - switch (c) { - case 0xBD: // dolby - // EBU Teletext data, ETSI EN 300 472 - if (b[i + 8] == 0x24 && b[i + 45] >= 0x10 && b[i + 45] < 0x20) { - cVDRTtxtsubsHookListener::Hook()->PlayerTeletextData(&b[i], l); - // continue with deleting the data - otherwise it disturbs DVB replay - int n = l; - for (int j = i; j < Length && n--; j++) - b[j] = 0x00; - } - break; - default: - break; - } - if (l) - i += l - 1; // the loop increments, too! - } - } -} // --- cPtsIndex ------------------------------------------------------------- @@ -557,10 +530,8 @@ void cDvbPlayer::Action(void) } if (p) { int w; - if (isPesRecording) { - StripExtendedPackets(p, pc); + if (isPesRecording) w = PlayPes(p, pc, playMode != pmPlay && !(playMode == pmSlow && playDir == pdForward) && DeviceIsPlayingVideo()); - } else w = PlayTs(p, pc, playMode != pmPlay && !(playMode == pmSlow && playDir == pdForward) && DeviceIsPlayingVideo()); if (w > 0) { |