Bugfix in TS concerning audio init data
This commit is contained in:
parent
dc409e8ab9
commit
3b70789e27
2 changed files with 2 additions and 7 deletions
|
@ -1,5 +1,3 @@
|
||||||
#define DEBUG 10
|
|
||||||
|
|
||||||
/// \file conn_ts.cpp
|
/// \file conn_ts.cpp
|
||||||
/// Contains the main code for the TS Connector
|
/// Contains the main code for the TS Connector
|
||||||
|
|
||||||
|
@ -16,7 +14,6 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/epoll.h>
|
|
||||||
#include <mist/socket.h>
|
#include <mist/socket.h>
|
||||||
#include <mist/config.h>
|
#include <mist/config.h>
|
||||||
#include <mist/stream.h>
|
#include <mist/stream.h>
|
||||||
|
@ -80,7 +77,6 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
|
||||||
}
|
}
|
||||||
if( IsKeyFrame ) {
|
if( IsKeyFrame ) {
|
||||||
TimeStamp = ( Strm.getPacket(0)["time"].asInt() * 27000 );
|
TimeStamp = ( Strm.getPacket(0)["time"].asInt() * 27000 );
|
||||||
fprintf( stderr, "Keyframe, timeStamp: %llu (%llu)\n", TimeStamp, (TimeStamp / 27000) );
|
|
||||||
}
|
}
|
||||||
int TSType;
|
int TSType;
|
||||||
bool FirstPic = true;
|
bool FirstPic = true;
|
||||||
|
@ -150,7 +146,7 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
|
||||||
} else if( Strm.lastType() == DTSC::AUDIO ) {
|
} else if( Strm.lastType() == DTSC::AUDIO ) {
|
||||||
WritePesHeader = true;
|
WritePesHeader = true;
|
||||||
DTMIData = Strm.lastData();
|
DTMIData = Strm.lastData();
|
||||||
ToPack = TS::GetAudioHeader( DTMIData.size() );
|
ToPack = TS::GetAudioHeader( DTMIData.size(), Strm.metadata["audio"]["init"].asString() );
|
||||||
ToPack += DTMIData;
|
ToPack += DTMIData;
|
||||||
TimeStamp = Strm.getPacket(0)["time"].asInt() * 81000;
|
TimeStamp = Strm.getPacket(0)["time"].asInt() * 81000;
|
||||||
while( ToPack.size() ) {
|
while( ToPack.size() ) {
|
||||||
|
|
|
@ -49,7 +49,6 @@ int main( ) {
|
||||||
}
|
}
|
||||||
if( IsKeyFrame ) {
|
if( IsKeyFrame ) {
|
||||||
TimeStamp = ( DTSCStream.getPacket(0)["time"].asInt() * 27000 );
|
TimeStamp = ( DTSCStream.getPacket(0)["time"].asInt() * 27000 );
|
||||||
fprintf( stderr, "Keyframe, timeStamp: %llu (%llu)\n", TimeStamp, (TimeStamp / 27000) );
|
|
||||||
}
|
}
|
||||||
int TSType;
|
int TSType;
|
||||||
bool FirstPic = true;
|
bool FirstPic = true;
|
||||||
|
@ -119,7 +118,7 @@ int main( ) {
|
||||||
} else if( DTSCStream.lastType() == DTSC::AUDIO ) {
|
} else if( DTSCStream.lastType() == DTSC::AUDIO ) {
|
||||||
WritePesHeader = true;
|
WritePesHeader = true;
|
||||||
DTMIData = DTSCStream.lastData();
|
DTMIData = DTSCStream.lastData();
|
||||||
ToPack = TS::GetAudioHeader( DTMIData.size() );
|
ToPack = TS::GetAudioHeader( DTMIData.size(), DTSCStream.metadata["audio"]["init"].asString() );
|
||||||
ToPack += DTMIData;
|
ToPack += DTMIData;
|
||||||
TimeStamp = DTSCStream.getPacket(0)["time"].asInt() * 81000;
|
TimeStamp = DTSCStream.getPacket(0)["time"].asInt() * 81000;
|
||||||
while( ToPack.size() ) {
|
while( ToPack.size() ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue