Segments bevatten nu alleen hele keyframes - added some extra references
This commit is contained in:
parent
7dca4ea5d6
commit
25640de402
1 changed files with 11 additions and 5 deletions
|
@ -126,6 +126,7 @@ int mainHandler(int CONN_fd){
|
||||||
std::string FlashBuf;
|
std::string FlashBuf;
|
||||||
std::string FlashMeta;
|
std::string FlashMeta;
|
||||||
bool Flash_ManifestSent = false;
|
bool Flash_ManifestSent = false;
|
||||||
|
bool Flash_RequestPending = false;
|
||||||
FLV_Pack * tag = 0;
|
FLV_Pack * tag = 0;
|
||||||
HTTPReader HTTP_R, HTTP_S;//HTTP Receiver en HTTP Sender.
|
HTTPReader HTTP_R, HTTP_S;//HTTP Receiver en HTTP Sender.
|
||||||
|
|
||||||
|
@ -180,11 +181,7 @@ int mainHandler(int CONN_fd){
|
||||||
printf( "Segment: %d\n", Segment );
|
printf( "Segment: %d\n", Segment );
|
||||||
printf( "Fragment: %d\n", ReqFragment );
|
printf( "Fragment: %d\n", ReqFragment );
|
||||||
#endif
|
#endif
|
||||||
HTTP_S.Clean();
|
Flash_RequestPending = true;
|
||||||
HTTP_S.SetHeader("Content-Type","video/mp4");
|
|
||||||
HTTP_S.SetBody(Interface::mdatFold(FlashBuf));
|
|
||||||
FlashBuf = "";
|
|
||||||
HTTP_S.SendResponse(CONN_fd, "200", "OK");//schrijf de HTTP response header
|
|
||||||
}else{
|
}else{
|
||||||
Movie = HTTP_R.url.substr(1);
|
Movie = HTTP_R.url.substr(1);
|
||||||
Movie = Movie.substr(0,Movie.find("/"));
|
Movie = Movie.substr(0,Movie.find("/"));
|
||||||
|
@ -246,6 +243,15 @@ int mainHandler(int CONN_fd){
|
||||||
if (FLV_GetPacket(tag, ss)){//able to read a full packet?
|
if (FLV_GetPacket(tag, ss)){//able to read a full packet?
|
||||||
if (handler == HANDLER_FLASH){
|
if (handler == HANDLER_FLASH){
|
||||||
if(tag->data[0] != 0x12 ) {
|
if(tag->data[0] != 0x12 ) {
|
||||||
|
if (tag->isKeyframe){
|
||||||
|
if (Flash_RequestPending){
|
||||||
|
HTTP_S.Clean();
|
||||||
|
HTTP_S.SetHeader("Content-Type","video/mp4");
|
||||||
|
HTTP_S.SetBody(Interface::mdatFold(FlashBuf));
|
||||||
|
FlashBuf = "";
|
||||||
|
HTTP_S.SendResponse(CONN_fd, "200", "OK");//schrijf de HTTP response header
|
||||||
|
}
|
||||||
|
}
|
||||||
FlashBuf.append(tag->data,tag->len);
|
FlashBuf.append(tag->data,tag->len);
|
||||||
} else {
|
} else {
|
||||||
FlashMeta = "";
|
FlashMeta = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue