Fixed small bugs in http smooth streaming.
This commit is contained in:
parent
22461badea
commit
4b63cce26a
2 changed files with 5 additions and 3 deletions
|
@ -317,7 +317,8 @@ namespace Connector_HTTP {
|
||||||
|
|
||||||
sstream << "t " << myRef["trackid"].asInt() << "\n";
|
sstream << "t " << myRef["trackid"].asInt() << "\n";
|
||||||
sstream << "s " << (requestedTime / 10000) << "\n";
|
sstream << "s " << (requestedTime / 10000) << "\n";
|
||||||
sstream << "p " << (mstime + mslen) <<"\n";
|
sstream << "o\n";
|
||||||
|
|
||||||
ss.SendNow(sstream.str().c_str());
|
ss.SendNow(sstream.str().c_str());
|
||||||
|
|
||||||
unsigned int myDuration;
|
unsigned int myDuration;
|
||||||
|
|
|
@ -154,6 +154,9 @@ namespace Converters {
|
||||||
meta["tracks"][currentID]["keys"][newNum]["num"] = ++trackData[currentID].keynum;
|
meta["tracks"][currentID]["keys"][newNum]["num"] = ++trackData[currentID].keynum;
|
||||||
meta["tracks"][currentID]["keys"][newNum]["time"] = F.getJSON()["time"];
|
meta["tracks"][currentID]["keys"][newNum]["time"] = F.getJSON()["time"];
|
||||||
meta["tracks"][currentID]["keys"][newNum]["bpos"] = F.getLastReadPos();
|
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){
|
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]["len"] = F.getJSON()["time"].asInt() - meta["tracks"][currentID]["keys"][newNum - 1]["time"].asInt();
|
||||||
meta["tracks"][currentID]["keys"][newNum - 1]["size"] = trackData[currentID].totalSize;
|
meta["tracks"][currentID]["keys"][newNum - 1]["size"] = trackData[currentID].totalSize;
|
||||||
|
@ -263,14 +266,12 @@ namespace Converters {
|
||||||
oriheader["moreheader"] = newHPos;
|
oriheader["moreheader"] = newHPos;
|
||||||
loader = oriheader.toPacked();
|
loader = oriheader.toPacked();
|
||||||
if (F.writeHeader(loader)){
|
if (F.writeHeader(loader)){
|
||||||
std::cerr << "Metadata is now: " << meta.toPrettyString(0) << std::endl;
|
|
||||||
return 0;
|
return 0;
|
||||||
}else{
|
}else{
|
||||||
std::cerr << "Failure rewriting header." << std::endl;
|
std::cerr << "Failure rewriting header." << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} //DTSCFix
|
} //DTSCFix
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Entry point for DTSCFix, simply calls Converters::DTSCFix().
|
/// Entry point for DTSCFix, simply calls Converters::DTSCFix().
|
||||||
|
|
Loading…
Add table
Reference in a new issue