diff options
Diffstat (limited to 'ttxtsubsdisplayer.c')
-rw-r--r-- | ttxtsubsdisplayer.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ttxtsubsdisplayer.c b/ttxtsubsdisplayer.c index b5b9815..295ea8d 100644 --- a/ttxtsubsdisplayer.c +++ b/ttxtsubsdisplayer.c @@ -152,7 +152,7 @@ cTtxtSubsPlayer::cTtxtSubsPlayer(int backup_textpage) // Take PES packets and break out the teletext data // Buffer the data for processing in a separate thread // XXX We should do some filtering here to avoid unneccessary load! -void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording) +void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording, const struct tTeletextSubtitlePage teletextSubtitlePages[]) { int i; @@ -163,6 +163,23 @@ void cTtxtSubsPlayer::PES_data(uchar *p, int Length, bool IsPesRecording) fprintf(stderr, "cTtxtSubsPlayer::PES_data: bad indata!\n"); } + if (!mFoundLangPage) + { + if (teletextSubtitlePages && teletextSubtitlePages[0].ttxtType) + { + for (int p=0; teletextSubtitlePages[p].ttxtType; p++) { + int ch = globals.langChoise(teletextSubtitlePages[p].ttxtLanguage, teletextSubtitlePages[p].ttxtType == 0x05); + if (ch >= 0 && ch < mLangChoise) { + mLangChoise = ch; + int bcdPage = (teletextSubtitlePages[p].ttxtMagazine << 8) + teletextSubtitlePages[p].ttxtPage; + mDisp->SetPage(bcdPage); + mFoundLangPage = 1; + fprintf(stderr, "Found subtitle page: %03x\n", bcdPage); // XXX + } + } + } + } + // Recorded teletext typically has payload type 0x10. // We use the payload type 0x1f to indicate that we have our own // filtered stream, if we find that we only use that. |