Fixed small bugs in http smooth streaming.

This commit is contained in:
Erik Zandvliet 2013-08-25 16:16:24 +02:00 committed by Thulinma
parent 22461badea
commit 4b63cce26a
2 changed files with 5 additions and 3 deletions

View file

@ -317,7 +317,8 @@ namespace Connector_HTTP {
sstream << "t " << myRef["trackid"].asInt() << "\n";
sstream << "s " << (requestedTime / 10000) << "\n";
sstream << "p " << (mstime + mslen) <<"\n";
sstream << "o\n";
ss.SendNow(sstream.str().c_str());
unsigned int myDuration;

View file

@ -154,6 +154,9 @@ namespace Converters {
meta["tracks"][currentID]["keys"][newNum]["num"] = ++trackData[currentID].keynum;
meta["tracks"][currentID]["keys"][newNum]["time"] = F.getJSON()["time"];
meta["tracks"][currentID]["keys"][newNum]["bpos"] = F.getLastReadPos();
if (newNum == 0){
trackData[currentID].firstms = F.getJSON()["time"].asInt();
}
if (meta["tracks"][currentID]["keys"].size() > 1){
meta["tracks"][currentID]["keys"][newNum - 1]["len"] = F.getJSON()["time"].asInt() - meta["tracks"][currentID]["keys"][newNum - 1]["time"].asInt();
meta["tracks"][currentID]["keys"][newNum - 1]["size"] = trackData[currentID].totalSize;
@ -263,14 +266,12 @@ namespace Converters {
oriheader["moreheader"] = newHPos;
loader = oriheader.toPacked();
if (F.writeHeader(loader)){
std::cerr << "Metadata is now: " << meta.toPrettyString(0) << std::endl;
return 0;
}else{
std::cerr << "Failure rewriting header." << std::endl;
return -1;
}
} //DTSCFix
}
/// Entry point for DTSCFix, simply calls Converters::DTSCFix().