Fixed HLS input support for streams without a keyframe in the first segment
This commit is contained in:
		
							parent
							
								
									66890c4564
								
							
						
					
					
						commit
						377d923cab
					
				
					 1 changed files with 65 additions and 57 deletions
				
			
		| 
						 | 
					@ -149,7 +149,7 @@ namespace Mist{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (key == "TARGETDURATION"){
 | 
					        if (key == "TARGETDURATION"){
 | 
				
			||||||
          waitTime = atoi(val.c_str()) / 2;
 | 
					          waitTime = atoi(val.c_str()) / 2;
 | 
				
			||||||
          if (waitTime < 2){waitTime = 2;}
 | 
					          if (waitTime < 5){waitTime = 5;}
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (key == "MEDIA-SEQUENCE"){fileNo = atoll(val.c_str());}
 | 
					        if (key == "MEDIA-SEQUENCE"){fileNo = atoll(val.c_str());}
 | 
				
			||||||
| 
						 | 
					@ -313,9 +313,12 @@ namespace Mist{
 | 
				
			||||||
    for (std::vector<Playlist>::iterator pListIt = playlists.begin(); pListIt != playlists.end();
 | 
					    for (std::vector<Playlist>::iterator pListIt = playlists.begin(); pListIt != playlists.end();
 | 
				
			||||||
         pListIt++){
 | 
					         pListIt++){
 | 
				
			||||||
      if (!pListIt->entries.size()){continue;}
 | 
					      if (!pListIt->entries.size()){continue;}
 | 
				
			||||||
      std::deque<playListEntries>::iterator entryIt = pListIt->entries.begin();
 | 
					      int preCounter = counter;
 | 
				
			||||||
 | 
					 | 
				
			||||||
      tsStream.clear();
 | 
					      tsStream.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      std::deque<playListEntries>::iterator entryIt = pListIt->entries.begin();
 | 
				
			||||||
 | 
					      while (true){
 | 
				
			||||||
        uint64_t lastBpos = entryIt->bytePos;
 | 
					        uint64_t lastBpos = entryIt->bytePos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (pListIt->isUrl()){
 | 
					        if (pListIt->isUrl()){
 | 
				
			||||||
| 
						 | 
					@ -378,6 +381,11 @@ namespace Mist{
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        in.close();
 | 
					        in.close();
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        //Go to next segment, abort if we found at least one track or ran out of segments.
 | 
				
			||||||
 | 
					        entryIt++;
 | 
				
			||||||
 | 
					        if (counter != preCounter || entryIt == pListIt->entries.end()){break;}
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    tsStream.clear();
 | 
					    tsStream.clear();
 | 
				
			||||||
    in.close();
 | 
					    in.close();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue