static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid, unsigned int pid)

{

    int i;

    struct Program *p = NULL;

    for(i=0; i<ts->nb_prg; i++) {

        if(ts->prg[i].id == programid) {

            p = &ts->prg[i];

            break;

        }

    }

    if(!p)

        return;



    if(p->nb_pids >= MAX_PIDS_PER_PROGRAM)

        return;

    p->pids[p->nb_pids++] = pid;

}

static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid, unsigned int pid)

{

    int i;

    struct Program *p = NULL;

    for(i=0; i<ts->nb_prg; i++) {

        if(ts->prg[i].id == programid) {

            p = &ts->prg[i];

            break;

        }

    }

    if(!p)

        return;



    if(p->nb_pids >= MAX_PIDS_PER_PROGRAM)

        return;

    p->pids[p->nb_pids++] = pid;

}

static void FUNC_0(MpegTSContext *VAR_0, unsigned int VAR_1, unsigned int VAR_2)

{

    int VAR_3;

    struct Program *VAR_4 = NULL;

    for(VAR_3=0; VAR_3<VAR_0->nb_prg; VAR_3++) {

        if(VAR_0->prg[VAR_3].id == VAR_1) {

            VAR_4 = &VAR_0->prg[VAR_3];

            break;

        }

    }

    if(!VAR_4)

        return;



    if(VAR_4->nb_pids >= MAX_PIDS_PER_PROGRAM)

        return;

    VAR_4->pids[VAR_4->nb_pids++] = VAR_2;

}

static void FUNC_0(MpegTSContext *VAR_0, unsigned int VAR_1, unsigned int VAR_2)
{ int VAR_3; struct Program *VAR_4 = NULL; for(VAR_3=0; VAR_3<VAR_0->nb_prg; VAR_3++) { if(VAR_0->prg[VAR_3].id == VAR_1) { VAR_4 = &VAR_0->prg[VAR_3]; break; } } if(!VAR_4)
return; if(VAR_4->nb_pids >= MAX_PIDS_PER_PROGRAM)
return; VAR_4->pids[VAR_4->nb_pids++] = VAR_2; }