Support video-only streams if there is no audio in the inbound stream. (#401)
Closes #400
This commit is contained in:
@@ -27,6 +27,7 @@ func setCurrentBroadcasterInfo(t flvio.Tag, remoteAddr string) {
|
||||
AudioBitrate: int(data.AudioBitrate),
|
||||
AudioCodec: getAudioCodec(data.AudioCodec),
|
||||
Encoder: data.Encoder,
|
||||
VideoOnly: data.AudioCodec == nil,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
||||
if t.Type == flvio.TAG_AMF0 {
|
||||
log.Tracef("%+v\n", t.DebugFields())
|
||||
setCurrentBroadcasterInfo(t, nc.RemoteAddr().String())
|
||||
_setStreamAsConnected()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +99,6 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
||||
}
|
||||
|
||||
_hasInboundRTMPConnection = true
|
||||
_setStreamAsConnected()
|
||||
_rtmpConnection = nc
|
||||
|
||||
f, err := os.OpenFile(pipePath, os.O_RDWR, os.ModeNamedPipe)
|
||||
|
||||
@@ -30,6 +30,10 @@ func getInboundDetailsFromMetadata(metadata []interface{}) (models.RTMPStreamMet
|
||||
}
|
||||
|
||||
func getAudioCodec(codec interface{}) string {
|
||||
if codec == nil {
|
||||
return "No audio"
|
||||
}
|
||||
|
||||
var codecID float64
|
||||
if assertedCodecID, ok := codec.(float64); ok {
|
||||
codecID = assertedCodecID
|
||||
|
||||
Reference in New Issue
Block a user