Branch: Tag:

2002-11-09

2002-11-09 14:07:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now uses C-style comments.

Rev: src/modules/DVB/dvb.c:1.15
Rev: src/modules/DVB/dvb.h:1.6

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dvb.c,v 1.14 2002/11/08 12:06:19 hop Exp $ + || $Id: dvb.c,v 1.15 2002/11/09 14:07:55 grubba Exp $   */      /*
199:       if((devname = malloc(sizeof(basename)+4)) == NULL)    return NULL; -  sprintf(devname, "%s%d", basename, devno); //FIXME: uncorrect for v2.0+ !! +  sprintf(devname, "%s%d", basename, devno); /* FIXME: uncorrect for v2.0+ !! */    return devname;   }   
250:    fefd = open (devname, O_RDWR | O_NONBLOCK);    if (fefd < 0) {    DVB->cardn = -1; -  //free(devname); +  /* free(devname); */    Pike_error("Opening frontend '%s' failed.\n", devname);    }    DVB->fefd = fefd;
506:    if((devname = mk_devname(DVB->cardn, SECDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    secfd = open (devname, O_RDWR); -  //free(devname); +  /* free(devname); */    if (secfd == -1) {    Pike_error ("opening SEC device failed\n");    }
556:    if((devname = mk_devname(DVB->cardn, DEMUXDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    dmx = open (devname, O_RDWR | O_NONBLOCK); -  //free(devname); +  /* free(devname); */    if (dmx < 0)    Pike_error("Opening demux failed.\n");    } else -  // FIXME: for which PMT ? +  /* FIXME: for which PMT ? */    dmx = DVB->stream->fd;    /* get the current PID settings */    THREADS_ALLOW();
737:       if (cks && crc32(buffer+1,n) != 0)    { -  fprintf(stderr,"crc error\n"); //FIXME: ??? +  fprintf(stderr,"crc error\n"); /* FIXME: ??? */    continue;    }   
769:    if((devname = mk_devname(DVB->cardn, DEMUXDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    dmx = open (devname, O_RDWR | O_NONBLOCK); -  //free(devname); +  /* free(devname); */    if (dmx < 0) {    snprintf (DVB->low_errmsg, MAX_ERR_LEN, "DMX SET SECTION FILTER.\n");    push_int(0);
883:    e->ecm_pid = ((data[2] & 0x1f) << 8) | data[3];    e->next = st->ecminfo;    st->ecminfo = e; - // printf("Found irdeto\n"); + /* printf("Found irdeto\n"); */    break;    case NAGRA_CA_SYSTEM:    e = malloc(sizeof(struct ECMINFO));
894:    e->ecm_pid = ((data[2] & 0x1f) << 8) | data[3];    e->next = st->ecminfo;    st->ecminfo = e; - //fprintf(stderr,"Found nagra\n"); + /* fprintf(stderr,"Found nagra\n"); */    break;    }   #ifdef DVB_DEBUG
933:    if((devname = mk_devname(DVB->cardn, DEMUXDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    dmx = open (devname, O_RDWR | O_NONBLOCK); -  //free(devname); +  /* free(devname); */    if (dmx < 0) {    snprintf (DVB->low_errmsg, MAX_ERR_LEN, "DMX SET SECTION FILTER.\n");    push_int(0);
973:       if (pnr != program_number)    { - //fprintf(stderr, "Can't find PMT entry\n"); + /* fprintf(stderr, "Can't find PMT entry\n"); */    push_int(0);    return;    }
1231:    if((devname = mk_devname(DVB->cardn, DEMUXDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    fd = open (devname, O_RDWR /*| O_NONBLOCK*/); -  //free(devname); +  /* free(devname); */    if (fd < 0) {    Pike_error("Opening DEMUX failed.\n");    }
1262:    DVBStream->pkt.payload = pktdata;    DVBStream->pkt.payload_len = 0;    /*DVB->pesfcb[ix] = NULL;*/ -  //fcntl(DVBStream->fd, F_SETFL, O_NONBLOCK); +  /*fcntl(DVBStream->fd, F_SETFL, O_NONBLOCK);*/   #if 0    push_int(1);   #else
1330:    e = errno; /* check_threads_etc may effect errno */    THREADS_DISALLOW();    -  //check_threads_etc(); +  /* check_threads_etc(); */       if (ret > 0) {    ret += DVBStream->pkt.payload_len;
1355:    bufptr = buf;    while((cnt = dvb_pes2es(bufptr,ret,&DVBStream->pkt, 0xC0)) > 0) {   #ifdef DVB_DEBUG -  //printf("DEB: dvb: PID(%d): cnt=%d (ix: %d): pkt.len=%d (skipped: %d)\n", DVBStream->pid, cnt, ix, DVBStream->pkt.payload_len, DVBStream->pkt.skipped); +  /* printf("DEB: dvb: PID(%d): cnt=%d (ix: %d): pkt.len=%d (skipped: %d)\n", DVBStream->pid, cnt, ix, DVBStream->pkt.payload_len, DVBStream->pkt.skipped); */    if(DVBStream->pkt.skipped)    printf("PID(%d): skipped: %d\n", DVBStream->pid, DVBStream->pkt.skipped);   #endif
1424:    if((devname = mk_devname(devno, AUDIODEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    DVBAudio->fd = open( devname, O_RDWR ); -  //free(devname); +  /* free(devname); */    if (DVBAudio->fd < 0) {    DVB->cardn = -1;    Pike_error("Opening audio device failed.\n");
1689:    add_function("create", f_create, "function(int|void:void)", 0);    add_function("_sprintf", f__sprintf, "function(int,mapping|void:mixed)", 0);    add_function("tune", f_zap, "function(int,int,int|string,int,mapping|void:int)", 0); -  //add_function("set_pids", f_set_pids, "function(string,mixed:int)", 0); +  /* add_function("set_pids", f_set_pids, "function(string,mixed:int)", 0); */    add_function("get_pids", f_get_pids, "function(:mapping|int)", 0);    add_function("analyze_pat", f_parse_pat, "function(:mapping|int)", 0);    add_function("analyze_pmt", f_parse_pmt, "function(int,int:array|int)", 0);