Changeset 11331


Ignore:
Timestamp:
01/14/17 11:38:58 (7 years ago)
Author:
theparasol
Message:

DVBAPI:

  • more fix for ticket #4486 (thanks ua2Ahfieghah)
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/module-dvbapi.c

    r11329 r11331  
    17621762}
    17631763
     1764static pthread_mutex_t lockindex = PTHREAD_MUTEX_INITIALIZER;
     1765
    17641766ca_index_t dvbapi_get_descindex(int32_t demux_index, int32_t pid, int32_t stream_id)
    17651767{
     
    17671769    ca_index_t idx = 0;
    17681770    uint32_t tmp_idx;
    1769 
    1770     static pthread_mutex_t lockindex;
    1771     static int8_t init_mutex = 0;
    1772    
    1773     if(init_mutex == 0)
    1774     {
    1775         SAFE_MUTEX_INIT(&lockindex, NULL);
    1776         init_mutex = 1;
    1777     }
    17781771   
    17791772    if(cfg.dvbapi_boxtype == BOXTYPE_NEUMO)
     
    19981991   
    19991992    memset(&demux[demux_id], 0 , sizeof(DEMUXTYPE));
     1993    SAFE_MUTEX_INIT(&demux[demux_id].answerlock, NULL);
    20001994    for(i = 0; i < ECM_PIDS; i++)
    20011995    {
     
    40774071}
    40784072
    4079 static pthread_mutex_t event_handler_lock;
    4080 static int8_t init_mutex = 0;
     4073static pthread_mutex_t event_handler_lock = PTHREAD_MUTEX_INITIALIZER;
    40814074
    40824075void event_handler(int32_t UNUSED(signal))
     
    40894082    uchar mbuf[2048]; // dirty fix: larger buffer needed for CA PMT mode 6 with many parallel channels to decode
    40904083    if(dvbapi_client != cur_client()) { return; }
    4091    
    4092     if(init_mutex == 0)
    4093     {
    4094         SAFE_MUTEX_INIT(&event_handler_lock, NULL);
    4095         init_mutex = 1;
    4096     }
    40974084
    40984085    SAFE_MUTEX_LOCK(&event_handler_lock);
     
    51795166    for(i = 0; i < MAX_DEMUX; i++)
    51805167    {
     5168        SAFE_MUTEX_INIT(&demux[i].answerlock, NULL);
    51815169        for(j = 0; j < ECM_PIDS; j++)
    51825170        {
     
    51865174            }
    51875175        }
     5176        demux[i].pidindex = -1;
     5177        demux[i].curindex = -1;
    51885178    }
    51895179   
     
    59835973
    59845974        if(er->rc < E_NOTFOUND && cfg.dvbapi_requestmode == 1 && er->caid != 0) // FOUND
    5985         {
    5986             if(demux[i].init_mutex == 0)
    5987             {
    5988                 SAFE_MUTEX_INIT(&demux[i].answerlock, NULL);
    5989                 demux[i].init_mutex = 1;   
    5990             }
    5991            
     5975        {   
    59925976            SAFE_MUTEX_LOCK(&demux[i].answerlock); // only process one ecm answer
    59935977           
  • trunk/module-dvbapi.h

    r11329 r11331  
    210210    uint8_t old_emmfiltercount; // previous emm filtercount
    211211    pthread_mutex_t answerlock; // requestmode 1 avoid race
    212     int8_t init_mutex;
    213212#ifdef WITH_STAPI
    214213    uint32_t DescramblerHandle[PTINUM];
Note: See TracChangeset for help on using the changeset viewer.