summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorvan <[email protected]>2008-09-16 21:53:56 +0000
committervan <[email protected]>2008-09-16 21:53:56 +0000
commitcb8392a6af3debd635e8f9027177dac9fb01cb24 (patch)
tree6a1bed79486afbbcdfc7f3e0b0d17a28ee1e302f /libhb/stream.c
parentc235b2520cfbafb3acdf2c0836b4df8e54882b50 (diff)
Bug fix to r1691: had the offsets for PTS & DTS reversed so we were trying to grab a DTS when there wasn't one.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1705 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rwxr-xr-xlibhb/stream.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index a6a54f616..5294919a2 100755
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -2209,20 +2209,20 @@ static int hb_ts_stream_decode( hb_stream_t *stream, uint8_t *obuf )
{
// PES must begin with an mpeg start code & contain
// a DTS or PTS.
- uint8_t *pes = buf + adapt_len + 4;
+ const uint8_t *pes = buf + adapt_len + 4;
if ( pes[0] != 0x00 || pes[1] != 0x00 || pes[2] != 0x01 ||
( pes[7] >> 6 ) == 0 )
{
continue;
}
// if we have a dts use it otherwise use the pts
- pes += (pes[7] & 0x40)? 9 : 14;
+ pes += (pes[7] & 0x40)? 14 : 9;
- pcr = ( ( (uint64_t)pes[0] >> 1 ) & 7 << 30 ) |
- ( (uint64_t)pes[1] << 22 ) |
- ( ( (uint64_t)pes[2] >> 1 ) << 15 ) |
- ( (uint64_t)pes[3] << 7 ) |
- ( (uint64_t)pes[4] >> 1 );
+ pcr = ( (uint64_t)(pes[0] & 0xe ) << 29 );
+ pcr |= ( pes[1] << 22 ) |
+ ( ( pes[2] >> 1 ) << 15 ) |
+ ( pes[3] << 7 ) |
+ ( pes[4] >> 1 );
stream->ts_nextpcr = pcr;
}
}