pike.git / src / modules / DVB / dvb.c

version» Context lines:

pike.git/src/modules/DVB/dvb.c:1:   /*   || 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.20 2003/05/12 20:21:33 mast Exp $ + || $Id: dvb.c,v 1.21 2003/09/10 15:21:58 mast Exp $   */      /*    * DVB module    *    * Creator: Honza Petrous <hop@unibase.cz>    *    * Credits:    * + Tuner zapping code inspired on 'szap' app from linux DVB driver    * package
pike.git/src/modules/DVB/dvb.c:173:    if(st != oldstream)    return 0;    if(st1 == NULL)    parent->stream = st->next;    else    st1->next = st->next;    return 1;      }    - dvb_stream_data *sl_getstream(dvb_data *parent, int pid) { + dvb_stream_data *sl_getstream(dvb_data *parent, unsigned int pid) {    dvb_stream_data *st = parent->stream;       if(st == NULL)    return 0;    while(st != NULL && st->pid != pid)    st = st->next;    if(st == NULL)    return 0;    return st;   
pike.git/src/modules/DVB/dvb.c:232:    */   static void f_create(INT32 args) {       int fefd;    char *devname;       if(DVB->cardn != -1)    Pike_error("Create already called!\n");       DVB->cardn = 0; -  if(args) +  if(args) {    if(Pike_sp[-1].type != T_INT)    Pike_error("Invalid argument 1, expected int.\n");    else    DVB->cardn = (u_short)Pike_sp[-1].u.integer; -  +  }       if((devname = mk_devname(DVB->cardn, FRONTENDDEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    fefd = open (devname, O_RDWR | O_NONBLOCK);    if (fefd < 0) {    DVB->cardn = -1;    /* free(devname); */    Pike_error("Opening frontend '%s' failed.\n", devname);    }    DVB->fefd = fefd;
pike.git/src/modules/DVB/dvb.c:913:    *!    *! @seealso    *! @[analyze_pat()]    */   static void f_parse_pmt(INT32 args)   {    unsigned char buffer[4096];    unsigned int length,info_len,data_len, index;    int retries;    int pid; -  int n,i; +  int n;       int pnr = -1;       int program_number;    int pmt_pid;    int dmx;    dvb_stream_data stream;    char *devname;    int cnt = 0, arr = 0;   
pike.git/src/modules/DVB/dvb.c:1019:    push_text("desc"); push_text("_rds"); cnt++;    break;    default:    push_text("unknown_type"); push_int(buffer[index]); cnt++;    push_text("desc"); push_text("unknown"); cnt++;    }       data_len = ((buffer[index+3] & 0x0F) << 8) + buffer[index+4];    if (buffer[index]==0x02 || buffer[index]==0x03 || buffer[index]==0x04)    { -  i = index+5; +  unsigned int i = index+5;    while (i < index+5+data_len)    {    switch (buffer[i])    {    case 0x0a:    if (buffer[index]==3 || buffer[index]==4) {    push_text("lang");    push_string(make_shared_binary_string(&buffer[i+2], 3)); cnt++;    }    break;
pike.git/src/modules/DVB/dvb.c:1074:    *! Type of payload data to read. By default, audio data is fetched.    *!    *! @note    *! Setting async callback doesn't set the object to nonblocking state.    *!    *! @seealso    *! @[DVB.Stream()->read()]    */   static void f_stream_attach(INT32 args) {    -  int err, pid, ptype = PID_NONE; +  int err, ptype = PID_NONE; +  unsigned int pid;    struct svalue feeder;    unsigned char *pktdata;       check_all_args("DVB.dvb->stream", args, BIT_INT,    BIT_FUNCTION | BIT_INT | BIT_VOID, BIT_INT | BIT_VOID, 0);       if(sl_count(DVB) >= MAX_PES_FD)    Pike_error("Max opened DEMUX devices reached.\n");       if(args > 2) {
pike.git/src/modules/DVB/dvb.c:1116:    push_int(ptype);    push_object( clone_object(dvb_stream_program, 4 ) );       if(Pike_sp[-1].type!=PIKE_T_OBJECT)    Pike_error("Failed to create Stream object!\n");      }      static void f__sprintf(INT32 args) {    -  unsigned int n = 0, x, cnt; +  int n = 0, x, cnt;    dvb_stream_data *st = DVB->stream;       check_all_args("DVB.dvb->_sprintf", args, BIT_INT, BIT_MAPPING | BIT_VOID, 0);       x = Pike_sp[-args].u.integer;    pop_n_elems(args);    switch (x) {    case 'O':    n++; push_text("DVB.dvb(");    n++; push_text(mk_devname(DVB->cardn, DEMUXDEVICE));
pike.git/src/modules/DVB/dvb.c:1424:    *! @param card_number    *! The number of card equipment.    */   static void f_audio_create(INT32 args) {    char *devname;    int devno = 0;       if(DVBAudio->fd != -1)    Pike_error("Create already called!\n");    -  if(args) +  if(args) {    if(Pike_sp[-1].type != T_INT)    Pike_error("Invalid argument 1, expected int.\n");    else    devno = (u_short)Pike_sp[-1].u.integer; -  +  }    pop_n_elems(args);    if((devname = mk_devname(devno, AUDIODEVICE)) == NULL)    Pike_error("Internal error: can't malloc buffer.\n");    DVBAudio->fd = open( devname, O_RDWR );    /* free(devname); */    if (DVBAudio->fd < 0) {    DVB->cardn = -1;    Pike_error("Opening audio device failed.\n");    }   }