mirror of https://bitbucket.org/ausocean/av.git
Got rid of writeFrame func we don't need
This commit is contained in:
parent
18cdcde149
commit
d82838dcc0
19
rtmp/rtmp.go
19
rtmp/rtmp.go
|
@ -205,25 +205,16 @@ func (s *session) rtmpWrite(r *C.RTMP, buf []byte) int {
|
|||
return size + s2
|
||||
}
|
||||
|
||||
func (s *session) writeFrame(data []byte) uint {
|
||||
if C.RTMP_IsConnected(s.rtmp) <= 0 {
|
||||
return 1
|
||||
}
|
||||
// This is where C.RTMP_Write would be used
|
||||
if s.rtmpWrite(s.rtmp, data) <= 0 {
|
||||
return 2
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Write writes a frame (flv tag) to the rtmp connection
|
||||
func (s *session) Write(data []byte) (int, error) {
|
||||
if s.rtmp == nil {
|
||||
return 0, Err(3)
|
||||
}
|
||||
ret := s.writeFrame(data)
|
||||
if ret != 0 {
|
||||
return 0, Err(ret)
|
||||
if C.RTMP_IsConnected(s.rtmp) <= 0 {
|
||||
return 0, Err(1)
|
||||
}
|
||||
if s.rtmpWrite(s.rtmp, data) <= 0 {
|
||||
return 0, Err(2)
|
||||
}
|
||||
return len(data), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue