Bugfix in TS concerning audio init data

This commit is contained in:
Erik Zandvliet 2012-12-17 13:52:00 +01:00 committed by Thulinma
parent dc409e8ab9
commit 3b70789e27
2 changed files with 2 additions and 7 deletions

View file

@ -1,5 +1,3 @@
#define DEBUG 10
/// \file conn_ts.cpp
/// Contains the main code for the TS Connector
@ -16,7 +14,6 @@
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <mist/socket.h>
#include <mist/config.h>
#include <mist/stream.h>
@ -80,7 +77,6 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
}
if( IsKeyFrame ) {
TimeStamp = ( Strm.getPacket(0)["time"].asInt() * 27000 );
fprintf( stderr, "Keyframe, timeStamp: %llu (%llu)\n", TimeStamp, (TimeStamp / 27000) );
}
int TSType;
bool FirstPic = true;
@ -150,7 +146,7 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
} else if( Strm.lastType() == DTSC::AUDIO ) {
WritePesHeader = true;
DTMIData = Strm.lastData();
ToPack = TS::GetAudioHeader( DTMIData.size() );
ToPack = TS::GetAudioHeader( DTMIData.size(), Strm.metadata["audio"]["init"].asString() );
ToPack += DTMIData;
TimeStamp = Strm.getPacket(0)["time"].asInt() * 81000;
while( ToPack.size() ) {

View file

@ -49,7 +49,6 @@ int main( ) {
}
if( IsKeyFrame ) {
TimeStamp = ( DTSCStream.getPacket(0)["time"].asInt() * 27000 );
fprintf( stderr, "Keyframe, timeStamp: %llu (%llu)\n", TimeStamp, (TimeStamp / 27000) );
}
int TSType;
bool FirstPic = true;
@ -119,7 +118,7 @@ int main( ) {
} else if( DTSCStream.lastType() == DTSC::AUDIO ) {
WritePesHeader = true;
DTMIData = DTSCStream.lastData();
ToPack = TS::GetAudioHeader( DTMIData.size() );
ToPack = TS::GetAudioHeader( DTMIData.size(), DTSCStream.metadata["audio"]["init"].asString() );
ToPack += DTMIData;
TimeStamp = DTSCStream.getPacket(0)["time"].asInt() * 81000;
while( ToPack.size() ) {