Bugfix in TS concerning audio init data, Makefile fix
This commit is contained in:
parent
611d4db3d7
commit
140fd4febf
3 changed files with 9 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
AM_CPPFLAGS = $(global_CFLAGS)
|
AM_CPPFLAGS = $(global_CFLAGS)
|
||||||
|
|
||||||
lib_LTLIBRARIES=libmist-1.0.la
|
lib_LTLIBRARIES=libmist-1.0.la
|
||||||
libmist_1_0_la_SOURCES=amf.h amf.cpp auth.h auth.cpp base64.h base64.cpp config.h config.cpp dtsc.h dtsc.cpp flv_tag.h flv_tag.cpp http_parser.h http_parser.cpp json.h json.cpp procs.h procs.cpp rtmpchunks.h rtmpchunks.cpp socket.h socket.cpp mp4.h mp4.cpp ftp.h ftp.cpp filesystem.h filesystem.cpp stream.h stream.cpp timing.h timing.cpp
|
libmist_1_0_la_SOURCES=amf.h amf.cpp auth.h auth.cpp base64.h base64.cpp config.h config.cpp dtsc.h dtsc.cpp flv_tag.h flv_tag.cpp http_parser.h http_parser.cpp json.h json.cpp procs.h procs.cpp rtmpchunks.h rtmpchunks.cpp socket.h socket.cpp mp4.h mp4.cpp ftp.h ftp.cpp filesystem.h filesystem.cpp stream.h stream.cpp timing.h timing.cpp ts_packet.cpp ts_packet.h
|
||||||
libmist_1_0_la_LIBADD=-lssl -lcrypto -lrt
|
libmist_1_0_la_LIBADD=-lssl -lcrypto -lrt
|
||||||
libmist_1_0_la_LDFLAGS = -version-info 3:0:0
|
libmist_1_0_la_LDFLAGS = -version-info 3:0:0
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ void TS::Packet::PCR( int64_t NewVal ) {
|
||||||
strBuf[4] = 0x07;
|
strBuf[4] = 0x07;
|
||||||
strBuf[5] = (strBuf[5] | 0x10 );
|
strBuf[5] = (strBuf[5] | 0x10 );
|
||||||
int64_t TmpVal = NewVal / 300;
|
int64_t TmpVal = NewVal / 300;
|
||||||
fprintf( stderr, "\tSetting PCR_Base: %d\n", TmpVal );
|
|
||||||
strBuf[6] = (((TmpVal>>1)>>24) & 0xFF);
|
strBuf[6] = (((TmpVal>>1)>>24) & 0xFF);
|
||||||
strBuf[7] = (((TmpVal>>1)>>16) & 0xFF);
|
strBuf[7] = (((TmpVal>>1)>>16) & 0xFF);
|
||||||
strBuf[8] = (((TmpVal>>1)>>8) & 0xFF);
|
strBuf[8] = (((TmpVal>>1)>>8) & 0xFF);
|
||||||
|
|
|
@ -54,12 +54,16 @@ namespace TS {
|
||||||
/// The length of this header will ALWAYS be 7 bytes, and has to be
|
/// The length of this header will ALWAYS be 7 bytes, and has to be
|
||||||
/// prepended on each audio frame.
|
/// prepended on each audio frame.
|
||||||
/// \param FrameLen the length of the current audio frame.
|
/// \param FrameLen the length of the current audio frame.
|
||||||
static inline std::string GetAudioHeader( int FrameLen ) {
|
static inline std::string GetAudioHeader( int FrameLen, std::string initData ) {
|
||||||
char StandardHeader[7] = {0xFF,0xF1,0x4C,0x80,0x00,0x1F,0xFC};
|
char StandardHeader[7] = {0xFF,0xF1,0x00,0x00,0x00,0x1F,0xFC};
|
||||||
FrameLen += 7;
|
FrameLen += 7;
|
||||||
StandardHeader[3] = ( StandardHeader[3] & 0xFC ) + ( ( FrameLen & 0x00001800 ) >> 11 );
|
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[3] |= ( ( FrameLen & 0x00001800 ) >> 11 );
|
||||||
StandardHeader[4] = ( ( FrameLen & 0x000007F8 ) >> 3 );
|
StandardHeader[4] = ( ( FrameLen & 0x000007F8 ) >> 3 );
|
||||||
StandardHeader[5] = ( StandardHeader[5] & 0x3F ) + ( ( FrameLen & 0x00000007 ) << 5 );
|
StandardHeader[5] |= ( ( FrameLen & 0x00000007 ) << 5 );
|
||||||
return std::string(StandardHeader,7);
|
return std::string(StandardHeader,7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue