commit c4505ee877c604be5bbac6c8756c2ecc2d606937
Author: Gregorio Gervasio, Jr <ggervasio@yahoo.com>
Date: Tue Jun 7 02:45:10 2011 -0700
Improved XDS check for SCTE field inversion.
diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index 4a66e86..34ac965 100644
|
a
|
b
|
void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte)
|
| 2435 | 2435 | field = cc_type ^ invert_scte_field; |
| 2436 | 2436 | } |
| 2437 | 2437 | |
| 2438 | | // in film mode, we may start at the wrong field; |
| 2439 | | // correct if XDS is detected (must be field 2) |
| 2440 | | if (scte && field == 0 && data1 == 0x01) |
| | 2438 | if (cc608_good_parity(cc608_parity_table, data)) |
| 2441 | 2439 | { |
| 2442 | | if (cc_type == 1) |
| 2443 | | invert_scte_field = 0; |
| 2444 | | field = 1; |
| 2445 | | } |
| | 2440 | // in film mode, we may start at the wrong field; |
| | 2441 | // correct if XDS start/cont/end code is detected (must be field 2) |
| | 2442 | if (scte && field == 0 && |
| | 2443 | (data1 & 0x7f) <= 0x0f && (data1 & 0x7f) != 0x00) |
| | 2444 | { |
| | 2445 | if (cc_type == 1) |
| | 2446 | invert_scte_field = 0; |
| | 2447 | field = 1; |
| 2446 | 2448 | |
| 2447 | | last_scte_field = field; |
| | 2449 | // flush decoder |
| | 2450 | ccd608->FormatCC(0, -1, -1); |
| | 2451 | } |
| 2448 | 2452 | |
| 2449 | | if (cc608_good_parity(cc608_parity_table, data)) |
| 2450 | | { |
| 2451 | 2453 | had_608 = true; |
| 2452 | 2454 | ccd608->FormatCCField(lastccptsu / 1000, field, data); |
| | 2455 | |
| | 2456 | last_scte_field = field; |
| 2453 | 2457 | } |
| 2454 | 2458 | } |
| 2455 | 2459 | else |