diff --git a/rtmp/session.go b/rtmp/session.go index aa4c0ac2..8ba30d1c 100644 --- a/rtmp/session.go +++ b/rtmp/session.go @@ -152,7 +152,7 @@ func (s *Session) Open() error { } // Close terminates the rtmp connection. -// NB: The session object is cleared completely. +// NB: Close is idempotent and the session value is cleared completely. func (s *Session) Close() error { s.log(DebugLevel, pkg+"Session.Close") if !s.isConnected() { @@ -174,12 +174,12 @@ func (s *Session) Write(data []byte) (int, error) { if !s.isConnected() { return 0, errNotConnected } - if data[0] == packetTypeInfo || (data[0] == 'F' && data[1] == 'L' && data[2] == 'V') { - return 0, errUnimplemented - } if len(data) < minDataSize { return 0, errTinyPacket } + if data[0] == packetTypeInfo || (data[0] == 'F' && data[1] == 'L' && data[2] == 'V') { + return 0, errUnimplemented + } pkt := packet{ packetType: data[0],