diff --git a/src/buffer/buffer_user.cpp b/src/buffer/buffer_user.cpp index caac5d98..3b70be6c 100644 --- a/src/buffer/buffer_user.cpp +++ b/src/buffer/buffer_user.cpp @@ -108,9 +108,10 @@ namespace Buffer { //switch to next buffer currsend = 0; if (Stream::get()->getStream()->isNewest(myRing->b)){ + //no next buffer? go in waiting mode. myRing->waiting = true; return false; - } //no next buffer? go in waiting mode. + } myRing->b = Stream::get()->getStream()->getNext(myRing->b, allowedTracks); if (Stream::get()->getStream()->getPacket(myRing->b).isMember("keyframe") && myRing->playCount > 0){ myRing->playCount--; diff --git a/src/connectors/conn_http_progressive.cpp b/src/connectors/conn_http_progressive.cpp index 9299f958..49229f3a 100644 --- a/src/connectors/conn_http_progressive.cpp +++ b/src/connectors/conn_http_progressive.cpp @@ -126,7 +126,6 @@ namespace Connector_HTTP { } int byterate = 0; for (JSON::ObjIter objIt = Strm.metadata["tracks"].ObjBegin(); objIt != Strm.metadata["tracks"].ObjEnd(); objIt++){ - std::cerr << objIt->second["type"].asString() << " => " << objIt->second["trackid"].asInt() << std::endl; if (videoID == -1 && objIt->second["type"].asString() == "video"){ videoID = objIt->second["trackid"].asInt(); } @@ -140,6 +139,7 @@ namespace Connector_HTTP { if (audioID != -1){ byterate += Strm.getTrackById(audioID)["bps"].asInt(); } + if ( !byterate){byterate = 1;} seek_sec = (seek_byte / byterate) * 1000; std::stringstream cmd; cmd << "t"; @@ -150,7 +150,7 @@ namespace Connector_HTTP { cmd << " " << audioID; } cmd << "\ns " << seek_sec << "\np\n"; - ss.SendNow(cmd.str().c_str()); + ss.SendNow(cmd.str().c_str(), cmd.str().size()); inited = true; } unsigned int now = Util::epoch(); @@ -158,7 +158,6 @@ namespace Connector_HTTP { lastStats = now; ss.SendNow(conn.getStats("HTTP_Progressive").c_str()); } - ///\todo UPDATE THIS TO DTSCv2 too if (ss.spool()){ while (Strm.parsePacket(ss.Received())){ if ( !progressive_has_sent_header){