Improved live support, fixed several minor related issues.

This commit is contained in:
Thulinma 2013-12-16 13:13:21 +01:00
parent ac84e8824b
commit 967f790e42
3 changed files with 6 additions and 9 deletions

View file

@ -250,7 +250,7 @@ namespace Buffer {
}
}
if (usr->myRing->waiting || !usr->myRing->playCount){
Util::sleep(300); //sleep 5ms
Util::sleep(300); //sleep 300ms
}
}
usr->Disconnect("Socket closed.");

View file

@ -145,7 +145,7 @@ namespace Buffer {
void Stream::deletionCallback(DTSC::livePos deleting){
tthread::lock_guard<tthread::recursive_mutex> guard(stats_mutex);
for (usersIt = users.begin(); usersIt != users.end(); usersIt++){
if ((*usersIt)->myRing->b == deleting){
if ((*usersIt)->myRing->playCount && (*usersIt)->myRing->b == deleting){
(*usersIt)->Disconnect("Buffer underrun");
}
}
@ -197,8 +197,9 @@ namespace Buffer {
void Stream::sendMeta(Socket::Connection & s){
if (metadata){
rw_mutex.lock();
metadata.send(s);
DTSC::Meta tmpMeta = metadata;
rw_mutex.unlock();
tmpMeta.send(s);
}
}

View file

@ -77,12 +77,8 @@ namespace Connector_HTTP {
long long int starttime = metadata.getKey(it->getNumber()).getTime();
if (it != (metadata.fragments.end() - 1)){
result << "#EXTINF:" << ((it->getDuration() + 500) / 1000) << ", no desc\r\n"
<< starttime << "_" << it->getDuration() + starttime << ".ts\r\n";
}else{
result << "#EXTINF:" << ((metadata.lastms - starttime + 500) / 1000) << ", no desc\r\n"
<< starttime << "_" << metadata.lastms << ".ts\r\n";
}
result << "#EXTINF:" << ((it->getDuration() + 500) / 1000) << ", no desc\r\n" << starttime << "_" << it->getDuration() + starttime << ".ts\r\n";
}
}
if ( !isLive){
result << "#EXT-X-ENDLIST\r\n";