mirror of https://bitbucket.org/ausocean/av.git
Return errors from the loop in connect() rather than breaking.
This commit is contained in:
parent
efe40a6778
commit
89d9bf3eef
12
rtmp/rtmp.go
12
rtmp/rtmp.go
|
@ -192,14 +192,14 @@ func connect(c *Conn) error {
|
||||||
c.log(WarnLevel, pkg+"sendConnect failed", "error", err.Error())
|
c.log(WarnLevel, pkg+"sendConnect failed", "error", err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.log(DebugLevel, pkg+"negotiating")
|
|
||||||
|
|
||||||
|
c.log(DebugLevel, pkg+"negotiating")
|
||||||
var buf [256]byte
|
var buf [256]byte
|
||||||
for !c.isPlaying {
|
for !c.isPlaying {
|
||||||
pkt := packet{buf: buf[:]}
|
pkt := packet{buf: buf[:]}
|
||||||
err = pkt.readFrom(c)
|
err = pkt.readFrom(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
switch pkt.packetType {
|
switch pkt.packetType {
|
||||||
|
@ -208,14 +208,10 @@ func connect(c *Conn) error {
|
||||||
default:
|
default:
|
||||||
err = handlePacket(c, &pkt)
|
err = handlePacket(c, &pkt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !c.isPlaying {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue