Added pushdelay option for outward pushes, fixed negative starttime for RTMP output
This commit is contained in:
		
							parent
							
								
									2475955125
								
							
						
					
					
						commit
						2cb20efa7a
					
				
					 2 changed files with 21 additions and 3 deletions
				
			
		|  | @ -1093,11 +1093,28 @@ namespace Mist{ | |||
|         seekPos = startRec; | ||||
|       } | ||||
|     }else{ | ||||
|       if (myMeta.live && targetParams.count("pushdelay")){ | ||||
|         INFO_MSG("Converting pushdelay syntax into corresponding startunix+realtime options"); | ||||
|         targetParams["startunix"] = std::string("-")+targetParams["pushdelay"]; | ||||
|         targetParams["realtime"] = "1"; | ||||
|       } | ||||
|       if (myMeta.live && (targetParams.count("startunix") || targetParams.count("stopunix"))){ | ||||
|         uint64_t unixStreamBegin = Util::epoch() - (liveTime() / 1000); | ||||
|         if (targetParams.count("startunix")){ | ||||
|           long long startUnix = atoll(targetParams["startunix"].c_str()); | ||||
|           if (startUnix < 0){startUnix += Util::epoch();} | ||||
|           if (startUnix < 0){ | ||||
|             long long origStartUnix = startUnix; | ||||
|             startUnix += Util::epoch(); | ||||
|             if (startUnix < unixStreamBegin){ | ||||
|               INFO_MSG("Waiting for stream to reach intended starting point"); | ||||
|               while (startUnix < Util::epoch() - (liveTime() / 1000) && keepGoing()){ | ||||
|                 Util::wait(1000); | ||||
|                 updateMeta(); | ||||
|                 stats(); | ||||
|                 startUnix = origStartUnix + Util::epoch(); | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|           if (startUnix < unixStreamBegin){ | ||||
|             WARN_MSG("Start time is earlier than stream begin - starting earliest possible"); | ||||
|             targetParams["start"] = "-1"; | ||||
|  |  | |||
|  | @ -43,8 +43,9 @@ namespace Mist{ | |||
|           streamOut = streamName; | ||||
|         } | ||||
|       } | ||||
|       initialize(); | ||||
|       INFO_MSG("About to push stream %s out. Host: %s, port: %d, app: %s, stream: %s", streamName.c_str(), pushUrl.host.c_str(), pushUrl.getPort(), app.c_str(), streamOut.c_str()); | ||||
|       initialize(); | ||||
|       initialSeek(); | ||||
|       startPushOut(""); | ||||
|     }else{ | ||||
|       setBlocking(true); | ||||
|  | @ -1094,7 +1095,7 @@ namespace Mist{ | |||
|           sendCommand(amfReply, 20, 1); | ||||
|         } | ||||
|         HIGH_MSG("Publish starting"); | ||||
|         realTime = 0; | ||||
|         if (!targetParams.count("realtime")){realTime = 0;} | ||||
|         parseData = true; | ||||
|         return; | ||||
|       } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma