From 439d5bf98cfb9b8927b949a9787b121fe20616a7 Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Thu, 27 Dec 2012 22:16:13 +0100 Subject: [PATCH] Changes for bipbop on ts. Audio now synchronises properly --- lib/ts_packet.cpp | 4 ++-- lib/ts_packet.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ts_packet.cpp b/lib/ts_packet.cpp index 07e7f54c..41040fa7 100644 --- a/lib/ts_packet.cpp +++ b/lib/ts_packet.cpp @@ -303,9 +303,9 @@ void TS::Packet::AddStuffing( int NumBytes ) { if( AdaptationField( ) == 3 ) { int Offset = strBuf[4]; strBuf[4] = Offset + NumBytes - 1; - strBuf.resize(7+Offset+NumBytes-2); + strBuf.resize(5+Offset+NumBytes-2); for( int i = 0; i < ( NumBytes -2 ); i ++ ) { - strBuf[6+Offset+i] = 0xFF; + strBuf[5+Offset+i] = 0xFF; } } else { AdaptationField( 3 ); diff --git a/lib/ts_packet.h b/lib/ts_packet.h index c85bd39d..4fb6a129 100644 --- a/lib/ts_packet.h +++ b/lib/ts_packet.h @@ -59,8 +59,8 @@ namespace TS { FrameLen += 7; StandardHeader[2] = ((((initData[0] >> 3) - 1) << 6 ) & 0xC0);//AAC Profile - 1 ( First two bits ) StandardHeader[2] |= (( ((initData[0] & 0x07) << 1) | ((initData[1] >> 7) & 0x01) ) << 2 );//AAC Frequency Index - StandardHeader[2] |= ((initData[1] & 0x20) >> 5); - StandardHeader[3] = ((initData[1] & 0x18 ) << 3 ); + StandardHeader[2] |= ((initData[1] & 0x20) >> 5);//AAC Channel Config + StandardHeader[3] = ((initData[1] & 0x18 ) << 3 );//AAC CHannel Config (cont.) StandardHeader[3] |= ( ( FrameLen & 0x00001800 ) >> 11 ); StandardHeader[4] = ( ( FrameLen & 0x000007F8 ) >> 3 ); StandardHeader[5] |= ( ( FrameLen & 0x00000007 ) << 5 ); @@ -87,9 +87,9 @@ namespace TS { /// A standard Program Mapping Table, as generated by FFMPEG. /// Contains both Audio and Video mappings, works also on video- or audio-only streams. static char PMT[188] = { - 0x47,0x50,0x00,0x10, 0x00,0x02,0xB0,0x1D, 0x00,0x01,0xC1,0x00, 0x00,0xE1,0x00,0xF0, - 0x00,0x1B,0xE1,0x00, 0xF0,0x00,0x0F,0xE1, 0x01,0xF0,0x06,0x0A, 0x04,0x65,0x6E,0x67, - 0x00,0x8D,0x82,0x9A, 0x07,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, + 0x47,0x50,0x00,0x10, 0x00,0x02,0xB0,0x17, 0x00,0x01,0xC1,0x00, 0x00,0xE1,0x00,0xF0, + 0x00,0x1B,0xE1,0x00, 0xF0,0x00,0x0F,0xE1, 0x01,0xF0,0x00,0x2F, 0x44,0xB9,0x9B,0xFF, + 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,