changeset 35029:7abba31768ec

Add new -subcc values. This makes it possible to specify that we should try to extract a EIA-608 compatibility stream instead of assuming the whole stream is EIA-608.
author reimar
date Mon, 27 Aug 2012 19:57:33 +0000
parents dd77d5a292df
children 97470e8b352f
files DOCS/man/en/mplayer.1 cfg-common.h sub/sub_cc.c
diffstat 3 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Mon Aug 27 19:51:33 2012 +0000
+++ b/DOCS/man/en/mplayer.1	Mon Aug 27 19:57:33 2012 +0000
@@ -2751,8 +2751,10 @@
 .PD 1
 .
 .TP
-.B "\-subcc <1\-4>\ "
+.B "\-subcc <1\-8>\ "
 Display DVD Closed Caption (CC) subtitles from the specified channel.
+Values 5 to 8 select a mode that can extract EIA-608 compatibility
+streams from EIA-708 data.
 These are
 .B not
 the VOB subtitles, these are special ASCII subtitles for the
--- a/cfg-common.h	Mon Aug 27 19:51:33 2012 +0000
+++ b/cfg-common.h	Mon Aug 27 19:57:33 2012 +0000
@@ -599,7 +599,7 @@
     // specify IFO file for VOBSUB subtitle
     {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL},
     // enable Closed Captioning display
-    {"subcc", &subcc_enabled, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL},
+    {"subcc", &subcc_enabled, CONF_TYPE_INT, CONF_RANGE, 0, 8, NULL},
     {"nosubcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL},
     {"overlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 2, NULL},
     {"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL},
--- a/sub/sub_cc.c	Mon Aug 27 19:51:33 2012 +0000
+++ b/sub/sub_cc.c	Mon Aug 27 19:57:33 2012 +0000
@@ -320,11 +320,20 @@
     data2 = current[2];
     current += 3; curbytes += 3;
 
+    // 0xfe/0xff are both used on plain EIA-608 CC and
+    // for extended EIA-708 (where 0xfc/0xfd is used for
+    // compatibility layer).
+    // Allow using channel bit 2 to select between which
+    // ones to look in.
     switch (cc_code) {
+    case 0xfc:
+    case 0xfd:
     case 0xfe:
     case 0xff:
+      if ((cc_code & 2) == (selected_channel() & 4) >> 1)
+          break;
       odd_offset ^= 1;
-      if (odd_offset != selected_channel() >> 1)
+      if (odd_offset != (selected_channel() & 2) >> 1)
           break;
       /* expect EIA-608 CC1/CC2 encoding */
       // FIXME check parity!
@@ -333,6 +342,7 @@
       cc_decode_EIA608(data1 | (data2 << 8));
       break;
 
+    case 0xfa:
     case 0x00:
       /* This seems to be just padding */
       break;