Changeset 1999


Ignore:
Timestamp:
04/07/10 18:17:08 (12 years ago)
Author:
_network
Message:

dvbapi: reset emm filter on hexserial change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module-dvbapi.c

    r1998 r1999  
    4949    unsigned char lastcw[2][8];
    5050    int emm_filter;
     51    uchar hexserial[8];
    5152    struct s_reader *rdr;
    5253   
     
    346347    ushort pid  = demux[demux_index].ECMpids[demux[demux_index].pidindex].EMM_PID;
    347348
    348     if (pid==0 || demux[demux_index].emm_filter==1 || !demux[demux_index].rdr)
     349    if (pid==0 || !demux[demux_index].rdr)
    349350        return;
    350351
     
    354355        //cs_debug("dvbapi: hexserial not set %s", cs_hexdump(1, demux[demux_index].rdr->hexserial, 8));
    355356        return;
     357    }
     358
     359    if (demux[demux_index].emm_filter==1 && !memcmp(demux[demux_index].rdr->hexserial, demux[demux_index].hexserial, 8)) {
     360        return;
     361    }
     362
     363    if (memcmp(demux[demux_index].rdr->hexserial, demux[demux_index].hexserial, 8)) {
     364        dvbapi_stop_filter(demux_index, TYPE_EMM);
    356365    }
    357366
     
    388397        dvbapi_set_filter(dmx_fd, selected_api, pid, filter, filter+16, 0);
    389398    }
     399
     400    memcpy(demux[demux_index].hexserial, demux[demux_index].rdr->hexserial, 8);
    390401    demux[demux_index].emm_filter=1;
    391402}
     
    617628    demux[demux_id].emm_filter=0;
    618629    demux[demux_id].rdr=NULL;
     630    memset(demux[demux_id].hexserial, 0, 8);
    619631
    620632    for (i=0;i<8;i++) {
     
    849861        demux[i].emm_filter=0;
    850862        demux[i].rdr=NULL;
     863        memset(demux[i].hexserial, 0, 8);
    851864        memset(demux[i].buffer_cache_dmx, 0, CS_ECMSTORESIZE);
    852865        for (rc=0;rc<MAX_FILTER;rc++) demux[i].demux_fd[rc].fd=0;
Note: See TracChangeset for help on using the changeset viewer.