Mercurial > mplayer.hg
comparison libmpdemux/demux_mpg.c @ 23722:5c5a3b4c0eb7
unified the skip of header and stuffing bytes after the parsing of pes_extension[12] fields
author | nicodvb |
---|---|
date | Sun, 08 Jul 2007 10:06:47 +0000 |
parents | 0ba2f26f2589 |
children | 148b85340a65 |
comparison
equal
deleted
inserted
replaced
23721:bf545b65d688 | 23722:5c5a3b4c0eb7 |
---|---|
360 c=stream_read_char(demux->stream); | 360 c=stream_read_char(demux->stream); |
361 dts=read_mpeg_timestamp(demux->stream,c); | 361 dts=read_mpeg_timestamp(demux->stream,c); |
362 len-=10;hdrlen-=10; | 362 len-=10;hdrlen-=10; |
363 } | 363 } |
364 len-=hdrlen; | 364 len-=hdrlen; |
365 if(hdrlen>0) { | 365 if(parse_ext2 && hdrlen>=3) { |
366 if(!parse_ext2) | |
367 stream_skip(demux->stream,hdrlen); // skip header bytes | |
368 else if(hdrlen>=3) { | |
369 c=stream_read_char(demux->stream); | 366 c=stream_read_char(demux->stream); |
370 hdrlen--; | 367 hdrlen--; |
371 | 368 |
372 if((c & 0x0F) != 0x0F) { | 369 if((c & 0x0F) != 0x0F) { |
373 mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: pes_extension_flag2 not set, discarding pes packet\n"); | 370 mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: pes_extension_flag2 not set, discarding pes packet\n"); |
412 if(c!=0x81) { mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: unknown pes_extension2 format, len is > 1 \n"); return -1;} | 409 if(c!=0x81) { mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: unknown pes_extension2 format, len is > 1 \n"); return -1;} |
413 c=stream_read_char(demux->stream); //pes_extension2 payload === substream id | 410 c=stream_read_char(demux->stream); //pes_extension2 payload === substream id |
414 hdrlen--; | 411 hdrlen--; |
415 if(c<0x55 || c>0x5F) { mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: unknown vc1 substream_id: 0x%x \n", c); return -1;} | 412 if(c<0x55 || c>0x5F) { mp_msg(MSGT_DEMUX,MSGL_V,"demux_mpg: unknown vc1 substream_id: 0x%x \n", c); return -1;} |
416 pes_ext2_subid=c; | 413 pes_ext2_subid=c; |
417 if(hdrlen>0) stream_skip(demux->stream, hdrlen); | |
418 } | 414 } |
419 } | 415 if(hdrlen>0) |
416 stream_skip(demux->stream,hdrlen); // skip header and stuffing bytes | |
420 | 417 |
421 if(id==0x1FD && pes_ext2_subid!=-1) { | 418 if(id==0x1FD && pes_ext2_subid!=-1) { |
422 //==== EVO VC1 STREAMS ===// | 419 //==== EVO VC1 STREAMS ===// |
423 if(!demux->v_streams[pes_ext2_subid]) new_sh_video(demux,pes_ext2_subid); | 420 if(!demux->v_streams[pes_ext2_subid]) new_sh_video(demux,pes_ext2_subid); |
424 if(demux->video->id==-1) demux->video->id=pes_ext2_subid; | 421 if(demux->video->id==-1) demux->video->id=pes_ext2_subid; |