From 8e7c9677b2593742cdcb38b8d6225fc04a6f1701 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 1 Apr 2010 22:14:08 +0000 Subject: [PATCH] fix a problem processing PS stream that look a lot like DVD PS but are not. these streams have start codes that all align on 2048 byte boundaries which makes them look like DVD PS. But within the 2048 bytes, they have multiple pack headers which we were tripping on. git-svn-id: svn://localhost/HandBrake/trunk@3181 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/demuxmpeg.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c index afeda30c..a0c01020 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; -- 2.11.0