mirror of https://bitbucket.org/ausocean/av.git
implemented endSession func
This commit is contained in:
parent
6e8ef99953
commit
cc616b12d4
12
rtmp/rtmp.go
12
rtmp/rtmp.go
|
@ -352,7 +352,7 @@ func (s *session) Close() error {
|
||||||
if s.rtmp == nil {
|
if s.rtmp == nil {
|
||||||
return Err(3)
|
return Err(3)
|
||||||
}
|
}
|
||||||
ret := C.end_session(s.rtmp)
|
ret := endSession(s.rtmp)
|
||||||
s.rtmp = nil
|
s.rtmp = nil
|
||||||
if ret != 0 {
|
if ret != 0 {
|
||||||
return Err(ret)
|
return Err(ret)
|
||||||
|
@ -360,6 +360,16 @@ func (s *session) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func endSession(rtmp *C.RTMP) uint32 {
|
||||||
|
if rtmp == nil {
|
||||||
|
return 3
|
||||||
|
}
|
||||||
|
|
||||||
|
C.RTMP_Close(rtmp)
|
||||||
|
C.RTMP_Free(rtmp)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// Write writes a frame (flv tag) to the rtmp connection
|
// Write writes a frame (flv tag) to the rtmp connection
|
||||||
func (s *session) Write(data []byte) (int, error) {
|
func (s *session) Write(data []byte) (int, error) {
|
||||||
if s.rtmp == nil {
|
if s.rtmp == nil {
|
||||||
|
|
Loading…
Reference in New Issue