Permalink
Browse files

Suppress duplicate CEA-608 captions.

  • Loading branch information...
1 parent 7c86000 commit f05b2d4e0042fb202900eec8b965f812b68341f2 @daniel-kristjansson daniel-kristjansson committed Sep 22, 2011
Showing with 15 additions and 1 deletion.
  1. +13 −1 mythtv/libs/libmythtv/cc608decoder.cpp
  2. +2 −0 mythtv/libs/libmythtv/cc608decoder.h
View
14 mythtv/libs/libmythtv/cc608decoder.cpp
@@ -37,6 +37,8 @@ CC608Decoder::CC608Decoder(CC608Input *ccr)
xds[i] = 0;
txtmode[i*2+0] = 0;
txtmode[i*2+1] = 0;
+ last_format_tc[i] = 0;
+ last_format_data[i] = 0;
}
// The following are not bzero() because MS Windows doesn't like it.
@@ -155,9 +157,19 @@ void CC608Decoder::FormatCCField(int tc, int field, int data)
return;
}
+ if ((last_format_data[field&1] == data) &&
+ (last_format_tc[field&1] == tc))
+ {
+ LOG(VB_VBI, LOG_DEBUG, "Format CC -- Duplicate");
+ return;
+ }
+
+ last_format_tc[field&1] = tc;
+ last_format_data[field&1] = data;
+
b1 = data & 0x7f;
b2 = (data >> 8) & 0x7f;
-#if 0
+#if 1
LOG(VB_VBI, LOG_DEBUG, QString("Format CC @%1/%2 = %3 %4")
.arg(tc).arg(field)
.arg((data&0xff), 2, 16)
View
2 mythtv/libs/libmythtv/cc608decoder.h
@@ -114,6 +114,8 @@ class CC608Decoder
// temporary buffer
unsigned char *rbuf;
+ int last_format_tc[2];
+ int last_format_data[2];
// VPS data
char vps_pr_label[20];

0 comments on commit f05b2d4

Please sign in to comment.