From 28f5ec6a4768ce4523e78b932184fbaf06869d70 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Thu, 6 Sep 2018 18:40:47 +0930 Subject: [PATCH] rtmp: make isready return a bool --- rtmp/rtmp.go | 4 ++-- rtmp/rtmp_headers.go | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index f46b6d57..0f1049ae 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -544,7 +544,7 @@ func C_RTMP_ConnectStream(r *C_RTMP, seekTime int32) (playing bool) { // TODO: read packet for !r.m_bPlaying && C_RTMP_IsConnected(r) != 0 && C_RTMP_ReadPacket(r, &packet) { // TODO: port is ready - if C_RTMPPacket_IsReady(&packet) != 0 { + if C_RTMPPacket_IsReady(&packet) { if packet.m_nBodySize == 0 { continue } @@ -1557,7 +1557,7 @@ func C_RTMP_ReadPacket(r *C_RTMP, packet *C_RTMPPacket) (ok bool) { } // TODO: port this - if C_RTMPPacket_IsReady(packet) != 0 { + if C_RTMPPacket_IsReady(packet) { if packet.m_hasAbsTimestamp == 0 { // timestamps seem to always be relative packet.m_nTimeStamp += *(*uint32)(incPtr(unsafe.Pointer(r.m_channelTimestamp), diff --git a/rtmp/rtmp_headers.go b/rtmp/rtmp_headers.go index c9985361..6b668c9c 100644 --- a/rtmp/rtmp_headers.go +++ b/rtmp/rtmp_headers.go @@ -147,11 +147,8 @@ type C_RTMPSockBuf struct { // RTMPPacket_IsReady(a) // rtmp.h +142 -func C_RTMPPacket_IsReady(p *C_RTMPPacket) int { - if p.m_nBytesRead == p.m_nBodySize { - return 1 - } - return 0 +func C_RTMPPacket_IsReady(p *C_RTMPPacket) bool { + return p.m_nBytesRead == p.m_nBodySize } // typedef struct RTMP_LNK