summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2012-01-22 09:26:20 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2012-01-22 09:26:20 (GMT)
commitf8312c35f01980be8d10a048cc23220f11864211 (patch)
treee809fc0276b3417cb98514fa9f6dac2b80ee72e0
parentd41ef68373a1a75bd7497a6d2ba31e217cded16b (diff)
CEA-708: Fix delayed presentation of some captions.
Patch from argilo@gmail.com (received with thanks) - see #10273 for details. Fixes a number of test streams with no obvious regressions. Closes #10273
-rw-r--r--mythtv/libs/libmythtv/avformatdecoder.cpp9
-rw-r--r--mythtv/libs/libmythtv/cc708decoder.cpp7
-rw-r--r--mythtv/libs/libmythtv/cc708decoder.h1
3 files changed, 15 insertions, 2 deletions
diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index 0e14e16..a5fa68e 100644
--- a/mythtv/libs/libmythtv/avformatdecoder.cpp
+++ b/mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -2559,8 +2559,6 @@ void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte)
{
uint cc_code = buf[2+(cur*3)];
bool cc_valid = cc_code & 0x04;
- if (!cc_valid)
- continue;
uint data1 = buf[3+(cur*3)];
uint data2 = buf[4+(cur*3)];
@@ -2568,6 +2566,13 @@ void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte)
uint cc_type = cc_code & 0x03;
uint field;
+ if (!cc_valid)
+ {
+ if (cc_type >= 0x2)
+ ccd708->decode_cc_null();
+ continue;
+ }
+
if (scte || cc_type <= 0x1) // EIA-608 field-1/2
{
if (cc_type == 0x2)
diff --git a/mythtv/libs/libmythtv/cc708decoder.cpp b/mythtv/libs/libmythtv/cc708decoder.cpp
index cb551c5..2838048 100644
--- a/mythtv/libs/libmythtv/cc708decoder.cpp
+++ b/mythtv/libs/libmythtv/cc708decoder.cpp
@@ -66,6 +66,13 @@ void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2)
}
}
+void CC708Decoder::decode_cc_null(void)
+{
+ if (partialPacket.size && reader)
+ parse_cc_packet(reader, &partialPacket, last_seen);
+ partialPacket.size = 0;
+}
+
void CC708Decoder::services(uint seconds, bool seen[64]) const
{
time_t now = time(NULL);
diff --git a/mythtv/libs/libmythtv/cc708decoder.h b/mythtv/libs/libmythtv/cc708decoder.h
index 4a00073..2b403aa 100644
--- a/mythtv/libs/libmythtv/cc708decoder.h
+++ b/mythtv/libs/libmythtv/cc708decoder.h
@@ -32,6 +32,7 @@ class CC708Decoder
~CC708Decoder() {}
void decode_cc_data(uint cc_type, uint data1, uint data2);
+ void decode_cc_null(void);
/// \return Services seen in last few seconds as specified.
void services(uint seconds, bool[64]) const;