X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fdemuxmpeg.c;h=4185cb5036201c636b6fdb66e87aeef253c38926;hb=4b72a63eb61a01275493c4bfb51ba02152d1c5e1;hp=afeda30c732ddd1b6ed0654fa7bfd9bc2a82c8f8;hpb=cca6e16aeaad0ea2e3aafa4543fe7d64477607cc;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c index afeda30c..4185cb50 100644 --- a/libhb/demuxmpeg.c +++ b/libhb/demuxmpeg.c @@ -106,6 +106,23 @@ int hb_demux_ps( hb_buffer_t * buf_ps, hb_list_t * list_es, hb_psdemux_t* state id = d[pos]; pos += 1; + /* pack_header */ + if( id == 0xBA) + { + pos += 10 + (d[pos+9] & 7); + continue; + } + + /* system_header */ + if( id == 0xBB ) + { + int header_length; + + header_length = ( d[pos] << 8 ) + d[pos+1]; + pos += 2 + header_length; + continue; + } + pes_packet_length = ( d[pos] << 8 ) + d[pos+1]; pos += 2; /* pes_packet_length */ pes_packet_end = pos + pes_packet_length; @@ -246,6 +263,10 @@ int hb_demux_ts( hb_buffer_t *buf_ps, hb_list_t *list_es, hb_psdemux_t *state ) hb_buffer_t *buf = hb_buffer_init( buf_ps->alloc ); hb_buffer_swap_copy( buf_ps, buf ); + if (buf->type == VIDEO_BUF) { + // Consume a chapter break + buf_ps->new_chap = 0; + } hb_list_add( list_es, buf ); return 1;