Changeset 11536


Ignore:
Timestamp:
Jul 29, 2019, 4:32:23 PM (4 months ago)
Author:
nautilus7
Message:

[dvbapi] Fixed "ca_pmt_cmd_id" value for PMT files

For CA PMT messages received via PMT files, set the "ca_pmt_cmd_id" to a proper value (ok_descrambling) instead of zero.
Also made few cosmetic changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module-dvbapi.c

    r11535 r11536  
    43184318            default:
    43194319            {
    4320                 cs_log_dbg(D_DVBAPI, "Received unknown CA PMT descriptor (tag: %02X length: %02X)",
     4320                cs_log_dbg(D_DVBAPI, "Skipped unsupported or CA PMT irrelevant descriptor (tag: %02X length: %02X)",
    43214321                    descriptor_tag, descriptor_length);
    43224322                break;
     
    54035403            }
    54045404        }
     5405
    54055406        cs_log_dump_dbg(D_DVBAPI, (uint8_t *)dest, len / 2, "QboxHD pmt.tmp:");
    54065407        demux_id = dvbapi_parse_capmt((uint8_t *)dest + 4, (len / 2) - 4, -1, dp->d_name, 0, 0);
     
    54175418            continue;
    54185419        }
    5419         cs_log_dump_dbg(D_DVBAPI, mbuf, len, "pmt:");
    5420 
    5421         dest[0] = 0x03;
    5422         dest[1] = mbuf[3];
    5423         dest[2] = mbuf[4];
    5424 
    5425         uint32_t pmt_program_length = b2i(2, mbuf + 10) & 0xFFF;
    5426         i2b_buf(2, pmt_program_length + 1, (uint8_t *) dest + 4);
    5427         dest[6] = 0;
     5420
     5421        cs_log_dump_dbg(D_DVBAPI, mbuf, len, "PMT file:"); // Original PMT file
     5422
     5423        // Do some tidying on the PMT file to make it compatible with the CA PMT parser
     5424        dest[0] = CA_PMT_LIST_ONLY;
     5425        memcpy(dest + 1, mbuf + 3, 2); // program_number
     5426        uint16_t pmt_program_info_length = b2i(2, mbuf + 10) & 0x0FFF;
     5427        i2b_buf(2, pmt_program_info_length + 1, (uint8_t *)dest + 4);
     5428        dest[6] = CA_PMT_CMD_OK_DESCRAMBLING;
    54285429        memcpy(dest + 7, mbuf + 12, len - 12 - 4);
    54295430
     5431        cs_log_dump_dbg(D_DVBAPI, (uint8_t *)dest, 7 + len - 12 - 4, "CA PMT:"); // Actual CA PMT message
    54305432        demux_id = dvbapi_parse_capmt((uint8_t *)dest, 7 + len - 12 - 4, -1, dp->d_name, 0, 0);
    54315433#endif
     5434
    54325435        if(demux_id >= 0)
    54335436        {
Note: See TracChangeset for help on using the changeset viewer.