summaryrefslogtreecommitdiff
path: root/dvbsubtitle.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-10-24 12:29:04 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2010-10-24 12:29:04 +0200
commitfbbcb8e9c88901b4a583fb688718b3dc6a5ceea2 (patch)
tree94afc2861881355a359b9d5ab405aa0fce9ec007 /dvbsubtitle.c
parentad650b58831e334651429d81c598d169a91488d6 (diff)
downloadvdr-fbbcb8e9c88901b4a583fb688718b3dc6a5ceea2.tar.gz
vdr-fbbcb8e9c88901b4a583fb688718b3dc6a5ceea2.tar.bz2
Removed the check for positive STC values from cDvbSubtitleConverter::Action()
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r--dvbsubtitle.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index 54943746..39dddb59 100644
--- a/dvbsubtitle.c
+++ b/dvbsubtitle.c
@@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
- * $Id: dvbsubtitle.c 2.7 2010/08/29 14:08:23 kls Exp $
+ * $Id: dvbsubtitle.c 2.8 2010/10/24 12:25:45 kls Exp $
*/
#include "dvbsubtitle.h"
@@ -781,7 +781,7 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
return 0;
}
-#define LimitTo32Bit(n) (n & 0x00000000FFFFFFFFL)
+#define LimitTo32Bit(n) ((n) & 0x00000000FFFFFFFFL)
#define MAXDELTA 40000 // max. reasonable PTS/STC delta in ms
void cDvbSubtitleConverter::Action(void)
@@ -801,17 +801,11 @@ void cDvbSubtitleConverter::Action(void)
Lock();
if (cDvbSubtitleBitmaps *sb = bitmaps->First()) {
int64_t STC = cDevice::PrimaryDevice()->GetSTC();
- int64_t Delta = 0;
- if (STC >= 0) {
- Delta = LimitTo32Bit(sb->Pts()) - LimitTo32Bit(STC); // some devices only deliver 32 bits
- if (Delta > (int64_t(1) << 31))
- Delta -= (int64_t(1) << 32);
- else if (Delta < -((int64_t(1) << 31) - 1))
- Delta += (int64_t(1) << 32);
- }
- else {
- //TODO sync on PTS? are there actually devices that don't deliver an STC?
- }
+ int64_t Delta = LimitTo32Bit(sb->Pts()) - LimitTo32Bit(STC); // some devices only deliver 32 bits
+ if (Delta > (int64_t(1) << 31))
+ Delta -= (int64_t(1) << 32);
+ else if (Delta < -((int64_t(1) << 31) - 1))
+ Delta += (int64_t(1) << 32);
Delta /= 90; // STC and PTS are in 1/90000s
if (Delta <= MAXDELTA) {
if (Delta <= 0) {