mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	Allow unique streampipe fifos. Closes #883
This commit is contained in:
		| @ -89,7 +89,7 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) { | |||||||
| 	log.Infoln("Inbound stream connected.") | 	log.Infoln("Inbound stream connected.") | ||||||
| 	_setStreamAsConnected() | 	_setStreamAsConnected() | ||||||
|  |  | ||||||
| 	pipePath := utils.GetTemporaryPipePath() | 	pipePath := utils.GetTemporaryPipePath(fmt.Sprint(data.GetRTMPPortNumber())) | ||||||
| 	if !utils.DoesFileExists(pipePath) { | 	if !utils.DoesFileExists(pipePath) { | ||||||
| 		err := syscall.Mkfifo(pipePath, 0666) | 		err := syscall.Mkfifo(pipePath, 0666) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
|  | |||||||
| @ -216,7 +216,7 @@ func NewTranscoder() *Transcoder { | |||||||
| 	// Playlists are available via the local HTTP server | 	// Playlists are available via the local HTTP server | ||||||
| 	transcoder.playlistOutputPath = config.PublicHLSStoragePath | 	transcoder.playlistOutputPath = config.PublicHLSStoragePath | ||||||
|  |  | ||||||
| 	transcoder.input = utils.GetTemporaryPipePath() | 	transcoder.input = utils.GetTemporaryPipePath(fmt.Sprint(data.GetRTMPPortNumber())) | ||||||
|  |  | ||||||
| 	for index, quality := range transcoder.currentStreamOutputSettings { | 	for index, quality := range transcoder.currentStreamOutputSettings { | ||||||
| 		variant := getVariantFromConfigQuality(quality, index) | 		variant := getVariantFromConfigQuality(quality, index) | ||||||
|  | |||||||
| @ -21,8 +21,8 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| // GetTemporaryPipePath gets the temporary path for the streampipe.flv file. | // GetTemporaryPipePath gets the temporary path for the streampipe.flv file. | ||||||
| func GetTemporaryPipePath() string { | func GetTemporaryPipePath(identifier string) string { | ||||||
| 	return filepath.Join(os.TempDir(), "streampipe.flv") | 	return filepath.Join(os.TempDir(), "streampipe."+identifier) | ||||||
| } | } | ||||||
|  |  | ||||||
| // DoesFileExists checks if the file exists. | // DoesFileExists checks if the file exists. | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Gabe Kangas
					Gabe Kangas