From 488d26d43e143015b39d65a2e52af86b95ae12eb Mon Sep 17 00:00:00 2001 From: Christian Vogler Date: Sun, 17 Mar 2002 02:56:37 +0000 Subject: fix a rare duplicate control code detection problem. Some DVDs apparently interleave all captioning codes with 0, 0 (no-ops). These must be ignored by the detection code. This fix makes the "Pearl Harbor" captions display correctly. CVS patchset: 1576 CVS date: 2002/03/17 02:56:37 --- src/libspucc/cc_decoder.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index d902a38fb..118c53e54 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cc_decoder.c,v 1.7 2002/03/11 12:31:26 guenter Exp $ + * $Id: cc_decoder.c,v 1.8 2002/03/17 02:56:37 cvogler Exp $ * * stuff needed to provide closed captioning decoding and display * @@ -1179,6 +1179,19 @@ static void cc_decode_EIA608(cc_decoder_t *this, uint16_t data) uint8_t c1 = data & 0x7f; uint8_t c2 = (data >> 8) & 0x7f; + /* Ignore 0 0 encoding altogether; don't even run it through the + duplicate CC control code detection. Some MPEG-2 streams + apparently encode all captions with 0, 0 interleaved. I am not + sure if this interleaving conforms to the EIA-608 standard, but + checking for it fixes rare captioning problems with some DVDs. + */ + if (c1 == 0 && c2 == 0) + return; + +#if LOG_DEBUG >= 3 + printf("decoding %x %x\n", c1, c2); +#endif + if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */ cc_decode_standard_char(this, c1, c2); } -- cgit v1.2.3