Ticket #10273: cc708-null-fix.patch

File cc708-null-fix.patch, 2.0 KB (added by argilo@…, 13 years ago)

fix for delayed closed captions

  • mythtv/libs/libmythtv/avformatdecoder.cpp

    diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
    index 0e14e16..6787d5e 100644
    a b void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte) 
    25592559    {
    25602560        uint cc_code  = buf[2+(cur*3)];
    25612561        bool cc_valid = cc_code & 0x04;
    2562         if (!cc_valid)
    2563             continue;
    25642562
    25652563        uint data1    = buf[3+(cur*3)];
    25662564        uint data2    = buf[4+(cur*3)];
    void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte) 
    25682566        uint cc_type  = cc_code & 0x03;
    25692567        uint field;
    25702568
     2569        if (!cc_valid) {
     2570            if (cc_type >= 0x2) {
     2571                ccd708->decode_cc_null();
     2572            }
     2573            continue;
     2574        }
     2575
    25712576        if (scte || cc_type <= 0x1) // EIA-608 field-1/2
    25722577        {
    25732578            if (cc_type == 0x2)
  • mythtv/libs/libmythtv/cc708decoder.cpp

    diff --git a/mythtv/libs/libmythtv/cc708decoder.cpp b/mythtv/libs/libmythtv/cc708decoder.cpp
    index cb551c5..516438f 100644
    a b void CC708Decoder::decode_cc_data(uint cc_type, uint data1, uint data2) 
    6666    }
    6767}
    6868
     69void CC708Decoder::decode_cc_null()
     70{
     71    if (partialPacket.size && reader)
     72        parse_cc_packet(reader, &partialPacket, last_seen);
     73
     74    partialPacket.size = 0;
     75}
     76
    6977void CC708Decoder::services(uint seconds, bool seen[64]) const
    7078{
    7179    time_t now = time(NULL);
  • mythtv/libs/libmythtv/cc708decoder.h

    diff --git a/mythtv/libs/libmythtv/cc708decoder.h b/mythtv/libs/libmythtv/cc708decoder.h
    index 4a00073..21bd499 100644
    a b class CC708Decoder 
    3232   ~CC708Decoder() {}
    3333
    3434    void decode_cc_data(uint cc_type, uint data1, uint data2);
     35    void decode_cc_null();
    3536
    3637    /// \return Services seen in last few seconds as specified.
    3738    void services(uint seconds, bool[64]) const;