summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Kangas <gabek@real-ity.com>2021-10-20 10:48:38 -0700
committerGabe Kangas <gabek@real-ity.com>2021-10-20 10:48:38 -0700
commit9a6623ddbd940bf563aec51adf517c073a856db9 (patch)
tree99111c0d6e0f41b76408a5f0d49aeaf0eb92386c
parent269475b423b3f2dd789a3ccc628d5001b12ea5b9 (diff)
Fix crash when an invalid inbound stream is disconnected. Closes #1439gek/invalid-inbound-stream-crash
-rw-r--r--core/streamState.go9
-rw-r--r--core/transcoder/utils.go2
2 files changed, 11 insertions, 0 deletions
diff --git a/core/streamState.go b/core/streamState.go
index 35a88b54b..33f2222a4 100644
--- a/core/streamState.go
+++ b/core/streamState.go
@@ -106,6 +106,15 @@ func SetStreamAsDisconnected() {
_yp.Stop()
}
+ // If there is no current broadcast available the previous stream
+ // likely failed for some reason. Don't try to append to it.
+ // Just transition to offline.
+ if _currentBroadcast == nil {
+ stopOnlineCleanupTimer()
+ transitionToOfflineVideoStreamContent()
+ return
+ }
+
for index := range _currentBroadcast.OutputSettings {
playlistFilePath := fmt.Sprintf(filepath.Join(config.HLSStoragePath, "%d/stream.m3u8"), index)
segmentFilePath := fmt.Sprintf(filepath.Join(config.HLSStoragePath, "%d/%s"), index, offlineFilename)
diff --git a/core/transcoder/utils.go b/core/transcoder/utils.go
index 83d6676df..d89cbfe9d 100644
--- a/core/transcoder/utils.go
+++ b/core/transcoder/utils.go
@@ -34,6 +34,7 @@ var errorMap = map[string]string{
`Unknown encoder 'h264_x264'`: "your copy of ffmpeg does not have support for the default x264 codec (h264_x264). download a version of ffmpeg that supports this.",
`Unrecognized option 'x264-params`: "your copy of ffmpeg does not have support for the default libx264 codec (h264_x264). download a version of ffmpeg that supports this.",
`Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Invalid argument`: "failed to set va-api device to /dev/dri/renderD128. your system is likely not properly configured for va-api",
+ `Stream map 'v:0' matches no streams`: "the stream provided looks to have no video included, it may be audio-only. owncast requires a video stream.",
// Generic error for a codec
"Unrecognized option": "error with codec. if your copy of ffmpeg or your hardware does not support your selected codec you may need to select another",
@@ -55,6 +56,7 @@ var ignoredErrors = []string{
"maybe the hls segment duration will not precise",
"Non-monotonous DTS in output",
"frames duplicated",
+ "To ignore this",
}
func handleTranscoderMessage(message string) {