summaryrefslogtreecommitdiff
path: root/src/libspucc/cc_decoder.c
diff options
context:
space:
mode:
authorChristian Vogler <cvogler@users.sourceforge.net>2002-03-17 02:56:37 +0000
committerChristian Vogler <cvogler@users.sourceforge.net>2002-03-17 02:56:37 +0000
commit488d26d43e143015b39d65a2e52af86b95ae12eb (patch)
tree81116b935831ed94c0166edb99e48adc701def8b /src/libspucc/cc_decoder.c
parente800d37461f33c820abf563c7212cd96036c64c7 (diff)
downloadxine-lib-488d26d43e143015b39d65a2e52af86b95ae12eb.tar.gz
xine-lib-488d26d43e143015b39d65a2e52af86b95ae12eb.tar.bz2
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
Diffstat (limited to 'src/libspucc/cc_decoder.c')
-rw-r--r--src/libspucc/cc_decoder.c15
1 files changed, 14 insertions, 1 deletions
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);
}