Additional memory upgrades and fix for Silverlight.
This commit is contained in:
parent
391f3cf174
commit
0379825a7d
3 changed files with 12 additions and 23 deletions
|
@ -81,20 +81,10 @@ int main(int argc, char** argv){
|
||||||
Socket::Connection in_out = Socket::Connection(fileno(stdout), fileno(stdin));
|
Socket::Connection in_out = Socket::Connection(fileno(stdout), fileno(stdin));
|
||||||
|
|
||||||
DTSC::File source = DTSC::File(conf.getString("filename"));
|
DTSC::File source = DTSC::File(conf.getString("filename"));
|
||||||
JSON::Value meta = source.getMeta();
|
in_out.SendNow(source.getMeta().toNetPacked());
|
||||||
std::string tmp = meta.toNetPacked();
|
|
||||||
for (JSON::ObjIter oIt = meta["tracks"].ObjBegin(); oIt != meta["tracks"].ObjEnd(); oIt++){
|
|
||||||
for (JSON::ArrIter aIt = oIt->second["keys"].ArrBegin(); aIt != oIt->second["keys"].ArrEnd(); aIt++){
|
|
||||||
(*aIt).removeMember("parts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//send the header
|
if ( !(source.getMeta().isMember("keytime") && source.getMeta().isMember("keybpos") && source.getMeta().isMember("keynum") && source.getMeta().isMember("keylen") && source.getMeta().isMember("frags"))
|
||||||
meta.netPrepare();
|
&& source.getMeta().isMember("video")){
|
||||||
in_out.SendNow(meta.toNetPacked());
|
|
||||||
|
|
||||||
if ( !(meta.isMember("keytime") && meta.isMember("keybpos") && meta.isMember("keynum") && meta.isMember("keylen") && meta.isMember("frags"))
|
|
||||||
&& meta.isMember("video")){
|
|
||||||
//file needs to be DTSCFix'ed! Run MistDTSCFix executable on it first
|
//file needs to be DTSCFix'ed! Run MistDTSCFix executable on it first
|
||||||
std::cerr << "Calculating / writing / updating VoD metadata..." << std::endl;
|
std::cerr << "Calculating / writing / updating VoD metadata..." << std::endl;
|
||||||
Util::Procs::Start("Fixer", Util::getMyPath() + "MistDTSCFix " + conf.getString("filename"));
|
Util::Procs::Start("Fixer", Util::getMyPath() + "MistDTSCFix " + conf.getString("filename"));
|
||||||
|
@ -105,8 +95,6 @@ int main(int argc, char** argv){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << meta.toNetPacked().size() << std::endl;
|
|
||||||
|
|
||||||
JSON::Value pausemark;
|
JSON::Value pausemark;
|
||||||
pausemark["datatype"] = "pause_marker";
|
pausemark["datatype"] = "pause_marker";
|
||||||
pausemark["time"] = (long long int)0;
|
pausemark["time"] = (long long int)0;
|
||||||
|
@ -114,9 +102,6 @@ int main(int argc, char** argv){
|
||||||
Socket::Connection StatsSocket = Socket::Connection(Util::getTmpFolder() + "statistics", true);
|
Socket::Connection StatsSocket = Socket::Connection(Util::getTmpFolder() + "statistics", true);
|
||||||
int lasttime = Util::epoch(); //time last packet was sent
|
int lasttime = Util::epoch(); //time last packet was sent
|
||||||
|
|
||||||
if (meta["video"]["keyms"].asInt() < 11){
|
|
||||||
meta["video"]["keyms"] = (long long int)1000;
|
|
||||||
}
|
|
||||||
JSON::Value last_pack;
|
JSON::Value last_pack;
|
||||||
|
|
||||||
bool meta_sent = false;
|
bool meta_sent = false;
|
||||||
|
@ -162,7 +147,7 @@ int main(int argc, char** argv){
|
||||||
json_sts["vod"]["now"] = Util::epoch();
|
json_sts["vod"]["now"] = Util::epoch();
|
||||||
json_sts["vod"]["start"] = Util::epoch() - sts.conntime;
|
json_sts["vod"]["start"] = Util::epoch() - sts.conntime;
|
||||||
if ( !meta_sent){
|
if ( !meta_sent){
|
||||||
json_sts["vod"]["meta"] = meta;
|
json_sts["vod"]["meta"] = source.getMeta();
|
||||||
for (JSON::ObjIter oIt = json_sts["vod"]["meta"]["tracks"].ObjBegin(); oIt != json_sts["vod"]["meta"]["tracks"].ObjEnd(); oIt++){
|
for (JSON::ObjIter oIt = json_sts["vod"]["meta"]["tracks"].ObjBegin(); oIt != json_sts["vod"]["meta"]["tracks"].ObjEnd(); oIt++){
|
||||||
oIt->second.removeMember("init");
|
oIt->second.removeMember("init");
|
||||||
oIt->second.removeMember("keys");
|
oIt->second.removeMember("keys");
|
||||||
|
|
|
@ -364,11 +364,13 @@ namespace Connector_HTTP {
|
||||||
trun_box.setFlags(MP4::trundataOffset | MP4::trunfirstSampleFlags | MP4::trunsampleDuration | MP4::trunsampleSize);
|
trun_box.setFlags(MP4::trundataOffset | MP4::trunfirstSampleFlags | MP4::trunsampleDuration | MP4::trunsampleSize);
|
||||||
trun_box.setDataOffset(42);
|
trun_box.setDataOffset(42);
|
||||||
trun_box.setFirstSampleFlags(0x00000040 | MP4::isIPicture | MP4::noDisposable | MP4::isKeySample);
|
trun_box.setFirstSampleFlags(0x00000040 | MP4::isIPicture | MP4::noDisposable | MP4::isKeySample);
|
||||||
for (int i = 0; i < keyObj["parts"].size(); i++){
|
std::deque<long long int> tmpParts;
|
||||||
|
JSON::decodeVector(keyObj["parts"].asString(), tmpParts);
|
||||||
|
for (int i = 0; i < tmpParts.size(); i++){
|
||||||
MP4::trunSampleInformation trunSample;
|
MP4::trunSampleInformation trunSample;
|
||||||
trunSample.sampleSize = keyObj["parts"][i].asInt();
|
trunSample.sampleSize = tmpParts[i];
|
||||||
//Guesstimate sample duration.
|
//Guesstimate sample duration.
|
||||||
trunSample.sampleDuration = ((double)(keyObj["len"].asInt() * 10000) / keyObj["parts"].size());
|
trunSample.sampleDuration = ((double)(keyObj["len"].asInt() * 10000) / tmpParts.size());
|
||||||
trun_box.setSampleInformation(trunSample, i);
|
trun_box.setSampleInformation(trunSample, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@ namespace Converters {
|
||||||
///\return The return code for the fixed program.
|
///\return The return code for the fixed program.
|
||||||
int DTSCFix(Util::Config & conf){
|
int DTSCFix(Util::Config & conf){
|
||||||
DTSC::File F(conf.getString("filename"));
|
DTSC::File F(conf.getString("filename"));
|
||||||
JSON::Value oriheader = F.getFirstMeta();
|
F.seek_bpos(0);
|
||||||
|
F.parseNext();
|
||||||
|
JSON::Value oriheader = F.getJSON();
|
||||||
JSON::Value meta = F.getMeta();
|
JSON::Value meta = F.getMeta();
|
||||||
JSON::Value pack;
|
JSON::Value pack;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue