Various small fixes to SRT and JSON outputs
This commit is contained in:
		
							parent
							
								
									1187b60454
								
							
						
					
					
						commit
						c78e695bad
					
				
					 2 changed files with 17 additions and 13 deletions
				
			
		|  | @ -50,6 +50,12 @@ namespace Mist { | |||
| 
 | ||||
|   void OutJSON::onHTTP(){ | ||||
|     std::string method = H.method; | ||||
|     jsonp = ""; | ||||
|     if (H.GetVar("callback") != ""){jsonp = H.GetVar("callback");} | ||||
|     if (H.GetVar("jsonp") != ""){jsonp = H.GetVar("jsonp");} | ||||
|     if (H.GetVar("track") != ""){ | ||||
|       selectedTracks.insert(JSON::Value(H.GetVar("track")).asInt()); | ||||
|     } | ||||
|      | ||||
|     H.Clean(); | ||||
|     H.setCORSHeaders(); | ||||
|  | @ -62,18 +68,17 @@ namespace Mist { | |||
|     } | ||||
|      | ||||
|     first = true; | ||||
|     jsonp = ""; | ||||
|     if (H.GetVar("callback") != ""){jsonp = H.GetVar("callback");} | ||||
|     if (H.GetVar("jsonp") != ""){jsonp = H.GetVar("jsonp");} | ||||
|     initialize(); | ||||
|     for (std::map<unsigned int,DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ | ||||
|       if (it->second.type == "meta" ){ | ||||
|         selectedTracks.insert(it->first); | ||||
|     if (!selectedTracks.size()){ | ||||
|       for (std::map<unsigned int,DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ | ||||
|         if (it->second.type == "meta" ){ | ||||
|           selectedTracks.insert(it->first); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     seek(0); | ||||
|     parseData = true; | ||||
|     wantRequest = false; | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -57,7 +57,10 @@ namespace Mist { | |||
| 
 | ||||
|   void OutProgressiveSRT::onHTTP(){ | ||||
|     std::string method = H.method; | ||||
|      | ||||
|     std::string url = H.url; | ||||
|     if (H.GetVar("track") != ""){ | ||||
|       selectedTracks.insert(JSON::Value(H.GetVar("track")).asInt()); | ||||
|     } | ||||
|     H.Clean(); | ||||
|     H.setCORSHeaders(); | ||||
|     if(method == "OPTIONS" || method == "HEAD"){ | ||||
|  | @ -68,12 +71,8 @@ namespace Mist { | |||
|       return; | ||||
|     } | ||||
|     lastNum = 0; | ||||
|     webVTT = (H.url.find(".webvtt") != std::string::npos); | ||||
|     if (H.GetVar("track") != ""){ | ||||
|       selectedTracks.insert(JSON::Value(H.GetVar("track")).asInt()); | ||||
|     } | ||||
|     parseData = true; | ||||
|     wantRequest = false; | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma