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

Fixed suddenly stopping subtitles in live mode

This commit is contained in:
Klaus Schmidinger 2007-11-18 15:21:51 +01:00
parent db4c8c3c76
commit 4227b6f082
2 changed files with 8 additions and 9 deletions

View File

@ -5519,7 +5519,7 @@ Video Disk Recorder Revision History
- Fixed decoding filename characters in case there are not two hex digits after - Fixed decoding filename characters in case there are not two hex digits after
the '#' (reported by Helmut Auer). the '#' (reported by Helmut Auer).
2007-11-17: Version 1.5.12 2007-11-18: Version 1.5.12
- Fixed assembling PS1 packets in cTS2PES::instant_repack() (thanks to Reinhard - Fixed assembling PS1 packets in cTS2PES::instant_repack() (thanks to Reinhard
Nissl). Nissl).
@ -5527,3 +5527,4 @@ Video Disk Recorder Revision History
- Fixed handling small PES packets that caused subtitles to be displayed late - Fixed handling small PES packets that caused subtitles to be displayed late
in live mode (based on a patch from Reinhard Nissl). in live mode (based on a patch from Reinhard Nissl).
- Fixed stopping live subtitles when a player is attached to the device. - Fixed stopping live subtitles when a player is attached to the device.
- Fixed suddenly stopping subtitles in live mode.

14
remux.c
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.62 2007/11/17 13:49:34 kls Exp $ * $Id: remux.c 1.63 2007/11/18 14:45:28 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -1427,7 +1427,6 @@ 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"
@ -1883,10 +1882,9 @@ public:
int cRingBufferLinearPes::DataReady(const uchar *Data, int Count) int cRingBufferLinearPes::DataReady(const uchar *Data, int Count)
{ {
int c = cRingBufferLinear::DataReady(Data, Count); int c = cRingBufferLinear::DataReady(Data, Count);
if (!c) { if (!c && Count >= 6) {
const uchar *p = Data; if (!Data[0] && !Data[1] && Data[2] == 0x01) {
if (Count >= 6 && !p[0] && !p[1] && p[2] == 0x01) { int Length = 6 + Data[4] * 256 + Data[5];
int Length = 6 + p[4] * 256 + p[5];
if (Length <= Count) if (Length <= Count)
return Length; return Length;
} }
@ -1936,7 +1934,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, SUBTITLE_PACKS, 0x00, 0x20 + n++); ts2pes[numTracks++] = new cTS2PES(*SPids++, resultBuffer, IPACKS, 0x00, 0x20 + n++);
} }
} }
@ -2034,7 +2032,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() < SUBTITLE_PACKS) if (resultBuffer->Free() < 2 * IPACKS)
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