Added Content-Length HTTP bug workaround for VLC versions < 2.2.0

This commit is contained in:
Thulinma 2015-02-18 15:09:41 +01:00
parent 32dfc25ee9
commit 44c0227064
3 changed files with 13 additions and 2 deletions

View file

@ -247,6 +247,14 @@ namespace Mist {
void OutHLS::onHTTP(){
AppleCompat = (H.GetHeader("User-Agent").find("Apple") != std::string::npos);
VLCworkaround = false;
if (H.GetHeader("User-Agent").substr(0, 3) == "VLC"){
std::string vlcver = H.GetHeader("User-Agent").substr(4);
if (vlcver[0] == '0' || vlcver[0] == '1' || (vlcver[0] == '2' && vlcver[2] < '2')){
DEBUG_MSG(DLVL_INFO, "Enabling VLC version < 2.2.0 bug workaround.");
VLCworkaround = true;
}
}
initialize();
if (H.url.find(".m3u") == std::string::npos){
std::string tmpStr = H.getUrl().substr(5+streamName.size());
@ -299,7 +307,7 @@ namespace Mist {
lastVid = from * 90;
H.SetHeader("Content-Type", "video/mp2t");
H.StartResponse(H, myConn);
H.StartResponse(H, myConn, VLCworkaround);
PacketNumber = 0;
parseData = true;
wantRequest = false;

View file

@ -26,6 +26,7 @@ namespace Mist {
char AudioCounter;
MP4::AVCC avccbox;
bool AppleCompat;
bool VLCworkaround;
long long unsigned int lastVid;
long long unsigned int until;
unsigned int vidTrack;

View file

@ -214,7 +214,9 @@ namespace Mist {
}
selectDefaultTracks();
onHTTP();
H.Clean();
if (!H.bufferChunks){
H.Clean();
}
}
}