Merge branch 'development' into LTS_development

# Conflicts:
#	src/input/input_buffer.cpp
This commit is contained in:
Thulinma 2015-12-25 15:44:23 +01:00
commit 8eb518606a
5 changed files with 15 additions and 19 deletions

View file

@ -653,13 +653,13 @@ namespace IPC {
///\brief Sets checksum field ///\brief Sets checksum field
void statExchange::crc(unsigned int sum) { void statExchange::crc(unsigned int sum) {
htobl(data + 186, sum); htobl(data + 168, sum);
} }
///\brief Gets checksum field ///\brief Gets checksum field
unsigned int statExchange::crc() { unsigned int statExchange::crc() {
unsigned int result; unsigned int result;
btohl(data + 186, result); btohl(data + 168, result);
return result; return result;
} }

View file

@ -11,7 +11,7 @@
#include <semaphore.h> #include <semaphore.h>
#endif #endif
#define STAT_EX_SIZE 172 #define STAT_EX_SIZE 174
#define PLAY_EX_SIZE 2+6*SIMUL_TRACKS #define PLAY_EX_SIZE 2+6*SIMUL_TRACKS
namespace IPC { namespace IPC {

View file

@ -167,6 +167,7 @@ namespace Mist {
long long unsigned int firstms = 0xFFFFFFFFFFFFFFFFull; long long unsigned int firstms = 0xFFFFFFFFFFFFFFFFull;
long long unsigned int lastms = 0; long long unsigned int lastms = 0;
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){
if (it->second.type == "meta" || !it->second.type.size()){continue;}
if (it->second.init.size()){ if (it->second.init.size()){
if (!initData.count(it->first) || initData[it->first] != it->second.init){ if (!initData.count(it->first) || initData[it->first] != it->second.init){
initData[it->first] = it->second.init; initData[it->first] = it->second.init;

View file

@ -144,7 +144,7 @@ namespace Mist {
/// Assumes streamName class member has been set already. /// Assumes streamName class member has been set already.
/// Will start input if not currently active, calls onFail() if this does not succeed. /// Will start input if not currently active, calls onFail() if this does not succeed.
/// After assuring stream is online, clears metaPages, then sets metaPages[0], statsPage and userClient to (hopefully) valid handles. /// After assuring stream is online, clears metaPages, then sets metaPages[0], statsPage and userClient to (hopefully) valid handles.
/// Finally, calls updateMeta() /// Finally, calls updateMeta() and stats()
void Output::reconnect(){ void Output::reconnect(){
if (!Util::startInput(streamName)){ if (!Util::startInput(streamName)){
DEBUG_MSG(DLVL_FAIL, "Opening stream failed - aborting initalization"); DEBUG_MSG(DLVL_FAIL, "Opening stream failed - aborting initalization");
@ -170,6 +170,7 @@ namespace Mist {
char userPageName[NAME_BUFFER_SIZE]; char userPageName[NAME_BUFFER_SIZE];
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str()); snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true); userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
stats();
updateMeta(); updateMeta();
} }

View file

@ -75,13 +75,8 @@ namespace Mist {
lines.push_back(line.str()); lines.push_back(line.str());
} }
//skip the first fragment if live and there are more than 2 fragments.
unsigned int skippedLines = 0; unsigned int skippedLines = 0;
if (myMeta.live){ if (myMeta.live){
if (lines.size() > 2){
lines.pop_front();
skippedLines++;
}
//only print the last segment when VoD //only print the last segment when VoD
lines.pop_back(); lines.pop_back();
/*LTS-START*/ /*LTS-START*/
@ -149,16 +144,15 @@ namespace Mist {
if ( !myMeta.tracks.size()){ if ( !myMeta.tracks.size()){
return 1; return 1;
} }
//loop trough all the tracks //check main track
for (std::map<unsigned int,DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ DTSC::Track & mainTrack = myMeta.tracks[*selectedTracks.begin()];
//return "too late" if one track is past this point //return "too late" if one track is past this point
if (ms < it->second.firstms){ if (ms < mainTrack.firstms){
return -1; return -1;
} }
//return "too early" if one track is not yet at this point //return "too early" if one track is not yet at this point
if (ms > it->second.lastms){ if (ms > mainTrack.lastms){
return 1; return 1;
}
} }
return 0; return 0;
} }