diff options
author | jstebbins <[email protected]> | 2010-04-01 22:14:08 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-04-01 22:14:08 +0000 |
commit | 13eb2d6d5e7ad894d0dfe808dc3cb26a062d48b7 (patch) | |
tree | dcd487eaf1a1fe1f9c4b405ab98a74f3dc2de09d /libhb | |
parent | e73f60520aa23505d4d85a5d8ff4277eb04b5d43 (diff) |
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://svn.handbrake.fr/HandBrake/trunk@3181 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/demuxmpeg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c index afeda30c7..a0c010208 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; |