mirror of https://bitbucket.org/ausocean/av.git
rtmp: make isready return a bool
This commit is contained in:
parent
b1c904ee22
commit
28f5ec6a47
|
@ -544,7 +544,7 @@ func C_RTMP_ConnectStream(r *C_RTMP, seekTime int32) (playing bool) {
|
||||||
// TODO: read packet
|
// TODO: read packet
|
||||||
for !r.m_bPlaying && C_RTMP_IsConnected(r) != 0 && C_RTMP_ReadPacket(r, &packet) {
|
for !r.m_bPlaying && C_RTMP_IsConnected(r) != 0 && C_RTMP_ReadPacket(r, &packet) {
|
||||||
// TODO: port is ready
|
// TODO: port is ready
|
||||||
if C_RTMPPacket_IsReady(&packet) != 0 {
|
if C_RTMPPacket_IsReady(&packet) {
|
||||||
if packet.m_nBodySize == 0 {
|
if packet.m_nBodySize == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1557,7 +1557,7 @@ func C_RTMP_ReadPacket(r *C_RTMP, packet *C_RTMPPacket) (ok bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: port this
|
// TODO: port this
|
||||||
if C_RTMPPacket_IsReady(packet) != 0 {
|
if C_RTMPPacket_IsReady(packet) {
|
||||||
if packet.m_hasAbsTimestamp == 0 {
|
if packet.m_hasAbsTimestamp == 0 {
|
||||||
// timestamps seem to always be relative
|
// timestamps seem to always be relative
|
||||||
packet.m_nTimeStamp += *(*uint32)(incPtr(unsafe.Pointer(r.m_channelTimestamp),
|
packet.m_nTimeStamp += *(*uint32)(incPtr(unsafe.Pointer(r.m_channelTimestamp),
|
||||||
|
|
|
@ -147,11 +147,8 @@ type C_RTMPSockBuf struct {
|
||||||
|
|
||||||
// RTMPPacket_IsReady(a)
|
// RTMPPacket_IsReady(a)
|
||||||
// rtmp.h +142
|
// rtmp.h +142
|
||||||
func C_RTMPPacket_IsReady(p *C_RTMPPacket) int {
|
func C_RTMPPacket_IsReady(p *C_RTMPPacket) bool {
|
||||||
if p.m_nBytesRead == p.m_nBodySize {
|
return p.m_nBytesRead == p.m_nBodySize
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// typedef struct RTMP_LNK
|
// typedef struct RTMP_LNK
|
||||||
|
|
Loading…
Reference in New Issue