Diff for /multiplexer/splicets.c between versions 1.20 and 1.21

version 1.20, 2004/01/16 14:54:12 version 1.21, 2004/01/23 01:39:04
Line 1 Line 1
 /*  /*
  * ISO 13818 stream multiplexer   * ISO 13818 stream multiplexer
  * Copyright (C) 2001 Convergence Integrated Media GmbH Berlin   * Copyright (C) 2001 Convergence Integrated Media GmbH Berlin
  * Author: Oskar Schirmer (oskar@scara.com)   * Copyright (C) 2004 Oskar Schirmer (oskar@scara.com)
  *   *
  * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
Line 96  void splice_setpsifrequency (t_msec freq Line 96  void splice_setpsifrequency (t_msec freq
   psi_frequency_changed = TRUE;    psi_frequency_changed = TRUE;
 }  }
   
 static int findapid (stream_descr *s)  static int findapid (stream_descr *s, int desire)
 {  {
   byte okness = 2;    byte okness = 2;
   int h;    int h;
     if (conservative_pid_assignment
      && (desire >= 0)
      && (outs[desire] == NULL)
      && (input_tssiinafilerange (desire) < 0)) {
       return (desire);
     }
   do {    do {
     if ((nextpid < TS_PID_SPLICELO) || (nextpid >= TS_PID_SPLICEHI)) {      if ((nextpid < TS_PID_SPLICELO) || (nextpid >= TS_PID_SPLICEHI)) {
       warn (LDEB,"Next PID",ETSC,1,okness,nextpid);        warn (LDEB,"Next PID",ETSC,1,okness,nextpid);
Line 167  void splice_addsirange (file_descr *f, Line 173  void splice_addsirange (file_descr *f,
         if ((s != NULL)          if ((s != NULL)
          && (s != PMT_STREAM)) {           && (s != PMT_STREAM)) {
           if (s->streamdata == sd_data) {            if (s->streamdata == sd_data) {
             i = findapid (s);              i = findapid (s, -1);
             if (input_tssiinafilerange (i) >= 0) { /* none free! */              if (input_tssiinafilerange (i) >= 0) { /* none free! */
               outs[i] = NULL;                outs[i] = NULL;
             } else {              } else {
Line 197  void splice_addsirange (file_descr *f, Line 203  void splice_addsirange (file_descr *f,
         if ((r >= lower)          if ((r >= lower)
          && (r <= upper)) {           && (r <= upper)) {
           int q;            int q;
           q = findapid (PMT_STREAM);            q = findapid (PMT_STREAM, -1);
           if (input_tssiinafilerange (q) >= 0) { /* none free! */            if (input_tssiinafilerange (q) >= 0) { /* none free! */
             outs[q] = NULL;              outs[q] = NULL;
           } else {            } else {
Line 329  prog_descr *splice_openprog (int program Line 335  prog_descr *splice_openprog (int program
   p = splice_getprog (programnb);    p = splice_getprog (programnb);
   if (p == NULL) {    if (p == NULL) {
     if (progs < MAX_OUTPROG) {      if (progs < MAX_OUTPROG) {
       if ((pid = findapid (PMT_STREAM)) > 0) {        if ((pid = findapid (PMT_STREAM, -1)) > 0) {
         if ((p = malloc(sizeof(prog_descr))) != NULL) {          if ((p = malloc(sizeof(prog_descr))) != NULL) {
           p->program_number = programnb;            p->program_number = programnb;
           p->pcr_pid = -1;            p->pcr_pid = -1;
Line 397  int splice_addstream (prog_descr *p, Line 403  int splice_addstream (prog_descr *p,
   int pid = 0;    int pid = 0;
   warn (LIMP,"Add stream",ETSC,4,force_sid,s->stream_id);    warn (LIMP,"Add stream",ETSC,4,force_sid,s->stream_id);
   if (p->streams < MAX_STRPERPRG) {    if (p->streams < MAX_STRPERPRG) {
 /* YenZi */      pid = findapid (s,(s->fdescr->content == ct_transport) ? s->sourceid : -1);
         pid = s->sourceid;  
     if (pid > 0) {      if (pid > 0) {
       if (!force_sid) {        if (!force_sid) {
         s->stream_id = splice_findfreestreamid (p,s->stream_id);          s->stream_id = splice_findfreestreamid (p,s->stream_id);

Removed from v.1.20  
changed lines
  Added in v.1.21


LinuxTV legacy CVS <linuxtv.org/cvs>