From 3b89a2a97e6652fbb613d50b771cbcfd8e396414 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 29 Sep 2002 13:50:17 +0200 Subject: Fixed handling DVD subtitles in the SPU decoder --- HISTORY | 1 + dvbspu.c | 10 ++++++---- dvbspu.h | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index 15c33967..e94fda9b 100644 --- a/HISTORY +++ b/HISTORY @@ -1532,3 +1532,4 @@ Video Disk Recorder Revision History - While learning the remote control keys it is now possible to press the 'Menu' key to skip the definition of keys that are not available on your particular RC unit. +- Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz). diff --git a/dvbspu.c b/dvbspu.c index 1e298590..95edb1bc 100644 --- a/dvbspu.c +++ b/dvbspu.c @@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.c 1.1 2002/09/08 14:17:35 kls Exp $ + * $Id: dvbspu.c 1.2 2002/09/29 13:48:39 kls Exp $ */ #include @@ -138,8 +138,8 @@ bool cDvbSpuBitmap::getMinSize(const aDvbSpuPalDescr paldescr, setMin(size.y1, minsize[i].y1); setMax(size.x2, minsize[i].x2); setMax(size.y2, minsize[i].y2); - ret = true; } + ret = true; } } if (ret) @@ -248,6 +248,7 @@ void cDvbSpuDecoder::processSPU(uint32_t pts, uint8_t * buf) spubmp = NULL; delete[]spu; spu = buf; + spupts = pts; DCSQ_offset = cmdOffs(); prev_DCSQ_offset = 0; @@ -402,7 +403,7 @@ int cDvbSpuDecoder::setTime(uint32_t pts) int i = DCSQ_offset; state = spNONE; - uint32_t exec_time = pts + spuU32(i) * 1024; + uint32_t exec_time = spupts + spuU32(i) * 1024; if ((pts != 0) && (exec_time > pts)) return 0; DEBUG("offs = %d, rel = %d, time = %d, pts = %d, diff = %d\n", @@ -416,7 +417,8 @@ int cDvbSpuDecoder::setTime(uint32_t pts) prev_DCSQ_offset = DCSQ_offset; DCSQ_offset = spuU32(i); - DEBUG("offs = %d, DCSQ = %d\n", i, DCSQ_offset); + DEBUG("offs = %d, DCSQ = %d, prev_DCSQ = %d\n", + i, DCSQ_offset, prev_DCSQ_offset); i += 2; while (spu[i] != CMD_SPU_EOF) { // Command Sequence diff --git a/dvbspu.h b/dvbspu.h index 5ac2d0ac..11bf7207 100644 --- a/dvbspu.h +++ b/dvbspu.h @@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.h 1.1 2002/09/08 14:17:38 kls Exp $ + * $Id: dvbspu.h 1.2 2002/09/29 13:49:01 kls Exp $ */ #ifndef __DVBSPU_H @@ -95,6 +95,7 @@ class cDvbSpuDecoder:public cSpuDecoder { // processing state uint8_t *spu; + uint32_t spupts; bool clean; bool ready; -- cgit v1.2.3