Fixed Ogg

This commit is contained in:
Oswald Auguste de Bruin 2013-08-28 10:58:49 +02:00 committed by Thulinma
parent a24b7c674e
commit 4ea25f2347

View file

@ -104,10 +104,10 @@ namespace Connector_HTTP {
Strm.waitForMeta(ss); Strm.waitForMeta(ss);
int byterate = 0; int byterate = 0;
for (JSON::ObjIter objIt = Strm.metadata["tracks"].ObjBegin(); objIt != Strm.metadata["tracks"].ObjEnd(); objIt++){ for (JSON::ObjIter objIt = Strm.metadata["tracks"].ObjBegin(); objIt != Strm.metadata["tracks"].ObjEnd(); objIt++){
if (videoID == -1 && objIt->second["codec"].asString() == "THEORA"){ if (videoID == -1 && objIt->second["codec"].asString() == "theora"){
videoID = objIt->second["trackid"].asInt(); videoID = objIt->second["trackid"].asInt();
} }
if (audioID == -1 && objIt->second["codec"].asString() == "VORBIS"){ if (audioID == -1 && objIt->second["codec"].asString() == "vorbis"){
audioID = objIt->second["trackid"].asInt(); audioID = objIt->second["trackid"].asInt();
} }
} }
@ -121,6 +121,13 @@ namespace Connector_HTTP {
if (seek_byte){ if (seek_byte){
seek_sec = (seek_byte / byterate) * 1000; seek_sec = (seek_byte / byterate) * 1000;
} }
if (videoID == -1 && audioID == -1){
HTTP_S.Clean(); //make sure no parts of old requests are left in any buffers
HTTP_S.SetBody("This stream contains no OGG compatible codecs");
HTTP_S.SendResponse("406", "Not acceptable",conn);
HTTP_R.Clean();
continue;
}
std::stringstream cmd; std::stringstream cmd;
cmd << "t"; cmd << "t";
if (videoID != -1){ if (videoID != -1){