[MPlayer-cvslog] r35123 - in trunk: DOCS/man/en/mplayer.1 cfg-common.h sub/sub_cc.c

reimar subversion at mplayerhq.hu
Mon Aug 27 21:57:33 CEST 2012


Author: reimar
Date: Mon Aug 27 21:57:33 2012
New Revision: 35123

Log:
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.

Modified:
   trunk/cfg-common.h
   trunk/sub/sub_cc.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h	Mon Aug 27 21:51:33 2012	(r35122)
+++ trunk/cfg-common.h	Mon Aug 27 21:57:33 2012	(r35123)
@@ -599,7 +599,7 @@ const m_option_t common_opts[] = {
     // 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},

Modified: trunk/sub/sub_cc.c
==============================================================================
--- trunk/sub/sub_cc.c	Mon Aug 27 21:51:33 2012	(r35122)
+++ trunk/sub/sub_cc.c	Mon Aug 27 21:57:33 2012	(r35123)
@@ -320,11 +320,20 @@ static void subcc_decode(const uint8_t *
     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 @@ static void subcc_decode(const uint8_t *
       cc_decode_EIA608(data1 | (data2 << 8));
       break;
 
+    case 0xfa:
     case 0x00:
       /* This seems to be just padding */
       break;


More information about the MPlayer-cvslog mailing list