rtmp: make isready return a bool

This commit is contained in:
Dan Kortschak 2018-09-06 18:40:47 +09:30
parent b1c904ee22
commit 28f5ec6a47
2 changed files with 4 additions and 7 deletions

View File

@ -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),

View File

@ -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