Changeset 11704


Ignore:
Timestamp:
11/28/21 02:12:56 (2 months ago)
Author:
nautilus7
Message:

[dvbapi] Use the PCR pid when video pid is missing from PMT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module-dvbapi.c

    r11695 r11704  
    41974197}
    41984198
    4199 static void dvbapi_parse_pmt_info(int32_t demux_id, const uint8_t *buffer, uint16_t length, uint8_t *ca_pmt_cmd_id)
     4199static void dvbapi_parse_pmt_info(int32_t demux_id, const uint8_t *buffer, uint16_t length, uint16_t pcr_pid, uint8_t *ca_pmt_cmd_id)
    42004200{
    42014201    uint16_t i, program_info_length, video_pid = 0;
     
    42474247        demux[demux_id].STREAMpidcount++;
    42484248        video_pid = demux[demux_id].pmtpid;
     4249    }
     4250
     4251    // Fix for channels not listing the video pid inside the PMT: use the pcr pid instead
     4252    if(video_pid == 0 && pcr_pid != 0x1FFF)
     4253    {
     4254        demux[demux_id].STREAMpids[demux[demux_id].STREAMpidcount] = pcr_pid;
     4255        demux[demux_id].STREAMpidsType[demux[demux_id].STREAMpidcount] = STREAM_VIDEO;
     4256        demux[demux_id].STREAMpidcount++;
     4257        video_pid = pcr_pid;
     4258
     4259        cs_log("Demuxer %d found no video pid. Using the PCR pid %04X instead", demux_id, pcr_pid);
    42494260    }
    42504261
     
    47134724    // For updated programs, we just delete all previous stream pids and
    47144725    // ECM pids and start parsing the fresh data.
    4715     dvbapi_parse_pmt_info(demux_id, buffer + 4, length - 4, &ca_pmt_cmd_id);
     4726    dvbapi_parse_pmt_info(demux_id, buffer + 4, length - 4, 0x1FFF, &ca_pmt_cmd_id);
    47164727
    47174728    // Finally, evaluate what response the host requires from OSCam.
     
    47544765{
    47554766    uint16_t program_number = b2i(2, buffer + 3);
     4767    uint16_t pcr_pid = b2i(2, buffer + 8) & 0x1FFF;
     4768
    47564769    if(program_number != demux[demux_id].program_number)
    47574770    {
     
    47614774
    47624775    dvbapi_stop_filter(demux_id, TYPE_PMT, msgid);
    4763     dvbapi_parse_pmt_info(demux_id, buffer + 10, length - 10 - 4, NULL); // last 4 bytes are the CRC-32
     4776    dvbapi_parse_pmt_info(demux_id, buffer + 10, length - 10 - 4, pcr_pid, NULL); // last 4 bytes are the CRC-32
    47644777}
    47654778
Note: See TracChangeset for help on using the changeset viewer.