Project

General

Profile

Bug #235 ยป vlc_h264_and_limited_PES.patch

Steven VS -, 2010-08-14 17:33

View differences:

src/parsers.c (working copy)
280 280

  
281 281
      if(st->st_ssc_ptr < 5)
282 282
	continue;
283

  
283
      uint16_t plen = st->st_ssc_buf[0] << 8 | st->st_ssc_buf[1];
284
      if(plen >= 0xffdf)st->st_incomplete=1;
285
      else st->st_incomplete=0;
284 286
      int hlen = st->st_ssc_buf[4];
285 287

  
286 288
      if(st->st_ssc_ptr < hlen + 5)
......
288 290
      
289 291
      parse_pes_header(t, st, st->st_ssc_buf + 2, hlen + 3);
290 292
      st->st_ssc_intercept = 0;
293
      if(st->st_buf.sb_ptr > 2) sc = st->st_buf.sb_data[st->st_buf.sb_ptr-3] << 16 | st->st_buf.sb_data[st->st_buf.sb_ptr-2] << 8 | st->st_buf.sb_data[st->st_buf.sb_ptr-1];
294

  
291 295
      continue;
292 296
    }
293 297

  
......
296 300

  
297 301
    if((sc & 0xffffff00) != 0x00000100)
298 302
      continue;
303
    if(sc == 0x100 && (len-i)>3) {
299 304

  
305
        uint32_t tempsc = data[i+1]<< 16 | data [i+2] << 8 | data [i+3];
306
        if(tempsc == 0x1e0)continue;
307
    }
308

  
300 309
    r = st->st_buf.sb_ptr - st->st_startcode_offset - 4;
301 310

  
302 311
    if(r > 0 && st->st_startcode != 0) {
......
951 960

  
952 961
  if(sc >= 0x000001e0 && sc <= 0x000001ef) {
953 962
    /* System start codes for video */
954
    if(len >= 9)
963
    if(len >= 9){
964
      uint16_t plen = buf[4] << 8 | buf[5];
965
      if(plen >= 0xffe9) st->st_incomplete =1;
955 966
      parse_pes_header(t, st, buf + 6, len - 6);
956

  
967
    }
957 968
    if(st->st_prevdts != PTS_UNSET && st->st_curdts != PTS_UNSET) {
958 969
      d = (st->st_curdts - st->st_prevdts) & 0x1ffffffffLL;
959 970

  
......
1023 1034

  
1024 1035
  if(next_startcode >= 0x000001e0 && next_startcode <= 0x000001ef) {
1025 1036
    /* Complete frame */
1026

  
1037
    if (st->st_incomplete) return 4;
1027 1038
    th_pkt_t *pkt = st->st_curpkt;
1028 1039
    
1029 1040
    if(pkt != NULL) {
src/tvhead.h (working copy)
426 426

  
427 427
  uint8_t *st_global_data;
428 428
  int st_global_data_len;
429

  
429
  int st_incomplete;
430 430
  int st_ssc_intercept;
431 431
  int st_ssc_ptr;
432 432
  uint8_t st_ssc_buf[32];
    (1-1/1)