Improved handling of later-added tracks
This commit is contained in:
		
							parent
							
								
									cbe4f017f3
								
							
						
					
					
						commit
						a9bc4e2134
					
				
					 2 changed files with 9 additions and 14 deletions
				
			
		|  | @ -106,20 +106,14 @@ namespace Mist{ | |||
|   } | ||||
| 
 | ||||
|   void OutDTSC::sendNext(){ | ||||
|     // If there are now more selectable tracks, select the new track and do a seek to the current
 | ||||
|     // timestamp Set sentHeader to false to force it to send init data
 | ||||
|     if (userSelect.size() < 2){ | ||||
|       static uint64_t lastMeta = 0; | ||||
|       if (Util::epoch() > lastMeta + 5){ | ||||
|         lastMeta = Util::epoch(); | ||||
|         std::set<size_t> validTracks = getSupportedTracks(); | ||||
|         if (validTracks.size() > 1){ | ||||
|           if (selectDefaultTracks()){ | ||||
|             INFO_MSG("Track selection changed - resending headers and continuing"); | ||||
|             sentHeader = false; | ||||
|             return; | ||||
|           } | ||||
|         } | ||||
|     // If selectable tracks changed, set sentHeader to false to force it to send init data
 | ||||
|     static uint64_t lastMeta = 0; | ||||
|     if (Util::epoch() > lastMeta + 5){ | ||||
|       lastMeta = Util::epoch(); | ||||
|       if (selectDefaultTracks()){ | ||||
|         INFO_MSG("Track selection changed - resending headers and continuing"); | ||||
|         sentHeader = false; | ||||
|         return; | ||||
|       } | ||||
|     } | ||||
|     DTSC::Packet p(thisPacket, thisIdx + 1); | ||||
|  |  | |||
|  | @ -1039,6 +1039,7 @@ namespace Mist{ | |||
|         newState = streamStatus.mapped[0]; | ||||
|       } | ||||
| 
 | ||||
|       if (meta){meta.refresh();} | ||||
|       if (newState != prevState || (newState == STRMSTAT_READY && M.getValidTracks() != prevTracks)){ | ||||
|         if (newState == STRMSTAT_READY){ | ||||
|           reconnect(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma