Fixes hls crash on non-existing streams
This commit is contained in:
		
							parent
							
								
									90c017bfcd
								
							
						
					
					
						commit
						c1373fba17
					
				
					 2 changed files with 9 additions and 4 deletions
				
			
		|  | @ -75,9 +75,6 @@ namespace Mist { | ||||||
|       virtual void onFail(); |       virtual void onFail(); | ||||||
|       virtual void requestHandler(); |       virtual void requestHandler(); | ||||||
|     private://these *should* not be messed with in child classes.
 |     private://these *should* not be messed with in child classes.
 | ||||||
|       inline bool keepGoing(){ |  | ||||||
|         return config->is_active && myConn; |  | ||||||
|       } |  | ||||||
|       std::map<unsigned long, unsigned int> currKeyOpen; |       std::map<unsigned long, unsigned int> currKeyOpen; | ||||||
|       void loadPageForKey(long unsigned int trackId, long long int keyNum); |       void loadPageForKey(long unsigned int trackId, long long int keyNum); | ||||||
|       int pageNumForKey(long unsigned int trackId, long long int keyNum); |       int pageNumForKey(long unsigned int trackId, long long int keyNum); | ||||||
|  | @ -119,6 +116,9 @@ namespace Mist { | ||||||
|       void waitForStreamPushReady(); |       void waitForStreamPushReady(); | ||||||
|       bool pushIsOngoing; |       bool pushIsOngoing; | ||||||
|       void bufferLivePacket(const DTSC::Packet & packet); |       void bufferLivePacket(const DTSC::Packet & packet); | ||||||
|  |       inline bool keepGoing(){ | ||||||
|  |         return config->is_active && myConn; | ||||||
|  |       } | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -175,8 +175,13 @@ namespace Mist { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     initialize(); |     initialize(); | ||||||
|  | 
 | ||||||
|  |     if (!keepGoing()){ | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if (H.url.find(".m3u") == std::string::npos){ |     if (H.url.find(".m3u") == std::string::npos){ | ||||||
|       std::string tmpStr = H.getUrl().substr(5+streamName.size()); |       std::string tmpStr = H.getUrl().substr(5 + streamName.size()); | ||||||
|       long long unsigned int from; |       long long unsigned int from; | ||||||
|       if (sscanf(tmpStr.c_str(), "/%u_%u/%llu_%llu.ts", &vidTrack, &audTrack, &from, &until) != 4){ |       if (sscanf(tmpStr.c_str(), "/%u_%u/%llu_%llu.ts", &vidTrack, &audTrack, &from, &until) != 4){ | ||||||
|         if (sscanf(tmpStr.c_str(), "/%u/%llu_%llu.ts", &vidTrack, &from, &until) != 3){ |         if (sscanf(tmpStr.c_str(), "/%u/%llu_%llu.ts", &vidTrack, &from, &until) != 3){ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Erik Zandvliet
						Erik Zandvliet