Merge branch 'development' into LTS_development
# Conflicts: # src/output/output.h
This commit is contained in:
commit
dc8bae8dd3
10 changed files with 80 additions and 30 deletions
|
@ -46,7 +46,7 @@ namespace Mist{
|
|||
cfg->addOption("noinput", option);
|
||||
}
|
||||
|
||||
void Output::bufferLivePacket(DTSC::Packet & packet){
|
||||
void Output::bufferLivePacket(const DTSC::Packet & packet){
|
||||
if (!pushIsOngoing){
|
||||
waitForStreamPushReady();
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace Mist {
|
|||
bool allowPush(const std::string & passwd);
|
||||
void waitForStreamPushReady();
|
||||
bool pushIsOngoing;
|
||||
void bufferLivePacket(DTSC::Packet & packet);
|
||||
void bufferLivePacket(const DTSC::Packet & packet);
|
||||
uint64_t firstPacketTime;
|
||||
uint64_t lastPacketTime;
|
||||
};
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <mist/stream.h>
|
||||
#include <mist/triggers.h>
|
||||
#include <mist/encode.h>
|
||||
#include <mist/util.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
@ -293,8 +294,7 @@ namespace Mist{
|
|||
0, 0, 0, 0}; //bytes 12-15 = extended timestamp
|
||||
char dataheader[] ={0, 0, 0, 0, 0};
|
||||
unsigned int dheader_len = 1;
|
||||
static char * swappyPointer = 0;
|
||||
static uint32_t swappySize = 0;
|
||||
static Util::ResizeablePointer swappy;
|
||||
char * tmpData = 0;//pointer to raw media data
|
||||
unsigned int data_len = 0;//length of processed media data
|
||||
thisPacket.getString("data", tmpData, data_len);
|
||||
|
@ -346,21 +346,12 @@ namespace Mist{
|
|||
dataheader[0] |= 0x10;
|
||||
}
|
||||
if (track.codec == "PCM"){
|
||||
if (track.size == 16){
|
||||
if (swappySize < data_len){
|
||||
char * tmp = (char*)realloc(swappyPointer, data_len);
|
||||
if (!tmp){
|
||||
FAIL_MSG("Could not allocate data for PCM endianness swap!");
|
||||
return;
|
||||
}
|
||||
swappyPointer = tmp;
|
||||
swappySize = data_len;
|
||||
}
|
||||
if (track.size == 16 && swappy.allocate(data_len)){
|
||||
for (uint32_t i = 0; i < data_len; i+=2){
|
||||
swappyPointer[i] = tmpData[i+1];
|
||||
swappyPointer[i+1] = tmpData[i];
|
||||
swappy[i] = tmpData[i+1];
|
||||
swappy[i+1] = tmpData[i];
|
||||
}
|
||||
tmpData = swappyPointer;
|
||||
tmpData = swappy;
|
||||
}
|
||||
dataheader[0] |= 0x30;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue