Changes for bipbop on ts. Audio now synchronises properly

This commit is contained in:
Erik Zandvliet 2012-12-27 22:16:13 +01:00
parent 140fd4febf
commit 439d5bf98c
2 changed files with 7 additions and 7 deletions

View file

@ -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 );

View file

@ -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,