# HG changeset patch # User reimar # Date 1346097093 0 # Node ID dd77d5a292df74b5434b243a3a8115c821e89e70 # Parent 6395c172f9c0d6d67785aa954702ee7adc38c92f Support closed-caption format as used in wtv format. Needs an FFmpeg fix so it marks them as CC instead of teletext. diff -r 6395c172f9c0 -r dd77d5a292df sub/sub_cc.c --- a/sub/sub_cc.c Mon Aug 27 16:20:40 2012 +0000 +++ b/sub/sub_cc.c Mon Aug 27 19:51:33 2012 +0000 @@ -54,6 +54,7 @@ static unsigned int cursor_pos=0; static int initialized=0; +static int wtv_format; #define CC_ROLLON 1 #define CC_ROLLUP 2 @@ -124,10 +125,12 @@ channel = -1; initialized=1; + wtv_format = 0; } void subcc_reset(void) { + wtv_format = 0; if (!initialized) return; clear_buffer(&buf1); @@ -385,6 +388,15 @@ mov_subcc_decode(inputdata, len); return; } + if (len & 1) wtv_format = 0; + if (len == 2) { + // EIA-608 compatibility part. + // Full EIA-708 parts have length >= 4 (multiple of 2). + cc_decode_EIA608(inputdata[0] | (inputdata[1] << 8)); + wtv_format = 1; + } + if (wtv_format) + return; subcc_decode(inputdata, len); }