- Made HLS no longer skip first fragment.

- Ignore metadata tracks and invalid tracks for buffer calculations.
- Fixed statistics.
This commit is contained in:
Thulinma 2015-12-25 14:37:32 +01:00
parent a604d616f7
commit 401fe65979
5 changed files with 6 additions and 9 deletions

View file

@ -652,13 +652,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

@ -57,6 +57,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

@ -116,7 +116,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");
@ -142,6 +142,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();
} }