summaryrefslogtreecommitdiff
path: root/dvbplayer.c
diff options
context:
space:
mode:
Diffstat (limited to 'dvbplayer.c')
-rw-r--r--dvbplayer.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dvbplayer.c b/dvbplayer.c
index 64fa559..18484fe 100644
--- a/dvbplayer.c
+++ b/dvbplayer.c
@@ -14,6 +14,7 @@
#include "ringbuffer.h"
#include "thread.h"
#include "tools.h"
+#include "vdrttxtsubshooks.h"
// --- cBackTrace ------------------------------------------------------------
@@ -312,6 +313,32 @@ void cDvbPlayer::Empty(void)
firstPacket = true;
}
+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!
+ }
+ }
+}
+
bool cDvbPlayer::NextFile(uchar FileNumber, int FileOffset)
{
if (FileNumber > 0)
@@ -503,6 +530,7 @@ void cDvbPlayer::Action(void)
}
}
if (p) {
+ StripExtendedPackets(p, pc);
int w = PlayPes(p, pc, playMode != pmPlay);
if (w > 0) {
p += w;