Diff for /multiplexer/splitpes.c between versions 1.8 and 1.9

version 1.8, 2004/06/17 22:04:07 version 1.9, 2006/07/14 18:15:52
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 (schirmer@scara.com)   * Copyright (C) 2004..2006 Oskar Schirmer (schirmer@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 74  int guess_streamtype (int streamid) Line 74  int guess_streamtype (int streamid)
  */   */
 boolean pes_skip_to_prefix (file_descr *f)  boolean pes_skip_to_prefix (file_descr *f)
 {  {
   unsigned int p;    int i, l, k, n;
   int i, l, k;    byte d;
   boolean r = FALSE;  
   l = k = list_size (f->data);    l = k = list_size (f->data);
   i = f->data.out;    i = f->data.out;
   p = 2;    n = 1;
   while ((l > 0)    d = f->data.ptr[i];
       && ((p != 0x000001) || (r = TRUE, FALSE))) {    while ((--l > 0)
     p = ((p & 0x0000FFFF) << 8) | f->data.ptr[i];        && ((n >= 0)
          || (d != 0x01))) {
     list_incr (i,f->data,1);      list_incr (i,f->data,1);
     l -= 1;      if (d) n = 1; else n -= 1;
       d = f->data.ptr[i];
   }    }
   k = k - l - PES_SYNC_SIZE;    k = k - l - PES_SYNC_SIZE;
   if (k > 0) {    if (k > 0) {
Line 93  boolean pes_skip_to_prefix (file_descr * Line 94  boolean pes_skip_to_prefix (file_descr *
     f->total += k;      f->total += k;
     list_incr (f->data.out,f->data,k);      list_incr (f->data.out,f->data,k);
   }    }
   return (r);    return ((n < 0) && (d == 0x01));
 }  }
   
 /* Determine the stream id of a packet.  /* Determine the stream id of a packet.

Removed from v.1.8  
changed lines
  Added in v.1.9


LinuxTV legacy CVS <linuxtv.org/cvs>