Fixed invalid DTSC packets causing progressive processes to block indefinitely.
This commit is contained in:
parent
6e9f797847
commit
391f3cf174
4 changed files with 26 additions and 3 deletions
|
@ -163,6 +163,12 @@ namespace Connector_HTTP {
|
||||||
if (Strm.lastType() == DTSC::PAUSEMARK){
|
if (Strm.lastType() == DTSC::PAUSEMARK){
|
||||||
conn.close();
|
conn.close();
|
||||||
}
|
}
|
||||||
|
if (Strm.lastType() == DTSC::INVALID){
|
||||||
|
#if DEBUG >= 3
|
||||||
|
fprintf(stderr, "Invalid packet received - closing connection.\n");
|
||||||
|
#endif
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
if (Strm.lastType() == DTSC::AUDIO || Strm.lastType() == DTSC::VIDEO){
|
if (Strm.lastType() == DTSC::AUDIO || Strm.lastType() == DTSC::VIDEO){
|
||||||
std::string codec = Strm.getTrackById(Strm.getPacket()["trackid"].asInt())["codec"].asString();
|
std::string codec = Strm.getTrackById(Strm.getPacket()["trackid"].asInt())["codec"].asString();
|
||||||
if (codec == "AAC" || codec == "MP3" || codec == "H264"){
|
if (codec == "AAC" || codec == "MP3" || codec == "H264"){
|
||||||
|
|
|
@ -132,10 +132,16 @@ namespace Connector_HTTP {
|
||||||
conn.SendNow(HTTP_S.BuildResponse("200", "OK")); //no SetBody = unknown length - this is intentional, we will stream the entire file
|
conn.SendNow(HTTP_S.BuildResponse("200", "OK")); //no SetBody = unknown length - this is intentional, we will stream the entire file
|
||||||
progressive_has_sent_header = true;
|
progressive_has_sent_header = true;
|
||||||
}
|
}
|
||||||
if(Strm.lastType() == DTSC::PAUSEMARK){
|
if (Strm.lastType() == DTSC::PAUSEMARK){
|
||||||
conn.close();
|
conn.close();
|
||||||
}
|
}
|
||||||
if(Strm.lastType() == DTSC::AUDIO){
|
if (Strm.lastType() == DTSC::INVALID){
|
||||||
|
#if DEBUG >= 3
|
||||||
|
fprintf(stderr, "Invalid packet received - closing connection.\n");
|
||||||
|
#endif
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
|
if (Strm.lastType() == DTSC::AUDIO){
|
||||||
conn.SendNow(Strm.lastData()); //write the MP3 contents
|
conn.SendNow(Strm.lastData()); //write the MP3 contents
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,6 +182,12 @@ namespace Connector_HTTP {
|
||||||
//parse DTSC to MP4 here
|
//parse DTSC to MP4 here
|
||||||
conn.SendNow(Strm.lastData());//send out and clear Convverter buffer
|
conn.SendNow(Strm.lastData());//send out and clear Convverter buffer
|
||||||
}
|
}
|
||||||
|
if (Strm.lastType() == DTSC::INVALID){
|
||||||
|
#if DEBUG >= 3
|
||||||
|
fprintf(stderr, "Invalid packet received - closing connection.\n");
|
||||||
|
#endif
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
Util::sleep(1);
|
Util::sleep(1);
|
||||||
|
|
|
@ -190,7 +190,12 @@ namespace Connector_HTTP {
|
||||||
if (Strm.lastType() == DTSC::PAUSEMARK){
|
if (Strm.lastType() == DTSC::PAUSEMARK){
|
||||||
conn.close();
|
conn.close();
|
||||||
//last page output
|
//last page output
|
||||||
|
}
|
||||||
|
if (Strm.lastType() == DTSC::INVALID){
|
||||||
|
#if DEBUG >= 3
|
||||||
|
fprintf(stderr, "Invalid packet received - closing connection.\n");
|
||||||
|
#endif
|
||||||
|
conn.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Add table
Reference in a new issue