RTMP track re-selection timer added.
This commit is contained in:
		
							parent
							
								
									7c46f008a8
								
							
						
					
					
						commit
						3c41142a57
					
				
					 1 changed files with 15 additions and 8 deletions
				
			
		|  | @ -271,15 +271,22 @@ namespace Mist { | ||||||
| 
 | 
 | ||||||
|     //If there are now more selectable tracks, select the new track and do a seek to the current timestamp
 |     //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
 |     //Set sentHeader to false to force it to send init data
 | ||||||
|     if (selectedTracks.size() < 2 && myMeta.tracks.size() > 1){ |     if (selectedTracks.size() < 2){ | ||||||
|       size_t prevTrackCount = selectedTracks.size(); |       static unsigned long long lastMeta = 0; | ||||||
|       selectDefaultTracks(); |       if (Util::epoch() > lastMeta + 5){ | ||||||
|       if (selectedTracks.size() > prevTrackCount){ |         lastMeta = Util::epoch(); | ||||||
|         INFO_MSG("Picked up new track - selecting it and resetting state."); |         updateMeta(); | ||||||
|         sentHeader = false; |         if (myMeta.tracks.size() > 1){ | ||||||
|         seek(thisPacket.getTime()); |           size_t prevTrackCount = selectedTracks.size(); | ||||||
|  |           selectDefaultTracks(); | ||||||
|  |           if (selectedTracks.size() > prevTrackCount){ | ||||||
|  |             INFO_MSG("Picked up new track - selecting it and resetting state."); | ||||||
|  |             sentHeader = false; | ||||||
|  |             initialSeek(); | ||||||
|  |             return; | ||||||
|  |           } | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|       return; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma