1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a possible blocking in replay when subtitles are active; fixed displaying subtitles in live mode

This commit is contained in:
Klaus Schmidinger 2007-11-03 14:39:25 +01:00
parent 06f813d2a8
commit db3e2a122d
3 changed files with 15 additions and 11 deletions

View File

@ -5503,3 +5503,5 @@ Video Disk Recorder Revision History
strings (thanks to Thomas Günther). strings (thanks to Thomas Günther).
- Added Ukrainian language texts (thanks to Yarema Aka Knedlyk). - Added Ukrainian language texts (thanks to Yarema Aka Knedlyk).
- Added a workaround for recovering from wrongfully interpreted "pre 1.3.19 PS1 packets". - Added a workaround for recovering from wrongfully interpreted "pre 1.3.19 PS1 packets".
- Fixed a possible blocking in replay when subtitles are active.
- Fixed displaying subtitles in live mode.

View File

@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de> * Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
* *
* $Id: dvbsubtitle.c 1.1 2007/10/12 14:27:30 kls Exp $ * $Id: dvbsubtitle.c 1.2 2007/11/03 14:36:07 kls Exp $
*/ */
#include "dvbsubtitle.h" #include "dvbsubtitle.h"
@ -692,7 +692,7 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00; bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00;
// Compatibility mode for old subtitles plugin: // Compatibility mode for old subtitles plugin:
if ((Data[PayloadOffset - 3] & 0x81) == 1 && Data[PayloadOffset - 2] == 0x81) { if ((Data[7] & 0x01) && (Data[PayloadOffset - 3] & 0x81) == 0x01 && Data[PayloadOffset - 2] == 0x81) {
PayloadOffset--; PayloadOffset--;
SubstreamHeaderLength = 1; SubstreamHeaderLength = 1;
ResetSubtitleAssembler = Data[8] >= 5; ResetSubtitleAssembler = Data[8] >= 5;
@ -730,8 +730,8 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
break; break;
} }
} }
return Length;
} }
return Length;
} }
return 0; return 0;
} }
@ -767,7 +767,7 @@ void cDvbSubtitleConverter::Action(void)
//TODO sync on PTS? are there actually devices that don't deliver an STC? //TODO sync on PTS? are there actually devices that don't deliver an STC?
} }
Delta /= 90; // STC and PTS are in 1/90000s Delta /= 90; // STC and PTS are in 1/90000s
if (abs(Delta) <= MAXDELTA) { if (Delta <= MAXDELTA) {
if (Delta <= 0) { if (Delta <= 0) {
dbgconverter("Got %d bitmaps, showing #%d\n", bitmaps->Count(), sb->Index() + 1); dbgconverter("Got %d bitmaps, showing #%d\n", bitmaps->Count(), sb->Index() + 1);
if (AssertOsd()) { if (AssertOsd()) {
@ -777,8 +777,8 @@ void cDvbSubtitleConverter::Action(void)
} }
bitmaps->Del(sb); bitmaps->Del(sb);
} }
else else if (Delta < WaitMs)
WaitMs = min(max(Delta, int64_t(0)), int64_t(1000)); WaitMs = Delta;
} }
else else
bitmaps->Del(sb); bitmaps->Del(sb);
@ -830,6 +830,8 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
pages->Add(page); pages->Add(page);
dbgpages("Create SubtitlePage %d (total pages = %d)\n", pageId, pages->Count()); dbgpages("Create SubtitlePage %d (total pages = %d)\n", pageId, pages->Count());
} }
if (Pts)
page->SetPts(Pts);
switch (segmentType) { switch (segmentType) {
case PAGE_COMPOSITION_SEGMENT: { case PAGE_COMPOSITION_SEGMENT: {
dbgsegments("PAGE_COMPOSITION_SEGMENT\n"); dbgsegments("PAGE_COMPOSITION_SEGMENT\n");
@ -837,8 +839,6 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
if (pageVersion == page->Version()) if (pageVersion == page->Version())
break; // no update break; // no update
page->SetVersion(pageVersion); page->SetVersion(pageVersion);
if (Pts)
page->SetPts(Pts);
page->SetTimeout(Data[6]); page->SetTimeout(Data[6]);
page->SetState((Data[6 + 1] & 0x0C) >> 2); page->SetState((Data[6 + 1] & 0x0C) >> 2);
page->regions.Clear(); page->regions.Clear();
@ -968,6 +968,7 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n"); dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n");
FinishPage(page); FinishPage(page);
} }
break;
default: default:
dbgsegments("*** unknown segment type: %02X\n", segmentType); dbgsegments("*** unknown segment type: %02X\n", segmentType);
} }

View File

@ -11,7 +11,7 @@
* The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>, * The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>,
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de. * and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
* *
* $Id: remux.c 1.59 2007/09/22 12:08:22 kls Exp $ * $Id: remux.c 1.60 2007/11/03 14:36:07 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -1427,6 +1427,7 @@ int cDolbyRepacker::BreakAt(const uchar *Data, int Count)
#define MMAX_PLENGTH (64*MAX_PLENGTH) // some stations send PES packets that are extremely large, e.g. DVB-T in Finland or HDTV 1920x1080 #define MMAX_PLENGTH (64*MAX_PLENGTH) // some stations send PES packets that are extremely large, e.g. DVB-T in Finland or HDTV 1920x1080
#define IPACKS 2048 #define IPACKS 2048
#define SUBTITLE_PACKS KILOBYTE(32)
// Start codes: // Start codes:
#define SC_SEQUENCE 0xB3 // "sequence header code" #define SC_SEQUENCE 0xB3 // "sequence header code"
@ -1911,7 +1912,7 @@ cRemux::cRemux(int VPid, const int *APids, const int *DPids, const int *SPids, b
if (SPids) { if (SPids) {
int n = 0; int n = 0;
while (*SPids && numTracks < MAXTRACKS && n < MAXSPIDS) while (*SPids && numTracks < MAXTRACKS && n < MAXSPIDS)
ts2pes[numTracks++] = new cTS2PES(*SPids++, resultBuffer, IPACKS, 0x00, 0x20 + n++); ts2pes[numTracks++] = new cTS2PES(*SPids++, resultBuffer, SUBTITLE_PACKS, 0x00, 0x20 + n++);
} }
} }
@ -2009,7 +2010,7 @@ int cRemux::Put(const uchar *Data, int Count)
break; break;
if (Data[i] != TS_SYNC_BYTE) if (Data[i] != TS_SYNC_BYTE)
break; break;
if (resultBuffer->Free() < 2 * IPACKS) if (resultBuffer->Free() < SUBTITLE_PACKS)
break; // A cTS2PES might write one full packet and also a small rest break; // A cTS2PES might write one full packet and also a small rest
int pid = GetPid(Data + i + 1); int pid = GetPid(Data + i + 1);
if (Data[i + 3] & 0x10) { // got payload if (Data[i + 3] & 0x10) { // got payload