Fix RTMP broadcast
This commit is contained in:
parent
07ea3688d5
commit
e75639a317
2 changed files with 6 additions and 5 deletions
5
main.go
5
main.go
|
@ -198,12 +198,11 @@ func main() {
|
||||||
|
|
||||||
switch ethFrame.SNAPProto {
|
switch ethFrame.SNAPProto {
|
||||||
case ethertalk.AARPProto:
|
case ethertalk.AARPProto:
|
||||||
log.Print("Got an AARP frame")
|
// log.Print("Got an AARP frame")
|
||||||
aarpCh <- ethFrame
|
aarpCh <- ethFrame
|
||||||
|
|
||||||
case ethertalk.AppleTalkProto:
|
case ethertalk.AppleTalkProto:
|
||||||
log.Print("Got an AppleTalk frame")
|
// log.Print("Got an AppleTalk frame")
|
||||||
|
|
||||||
var ddpkt ddp.ExtPacket
|
var ddpkt ddp.ExtPacket
|
||||||
if err := ddp.ExtUnmarshal(ethFrame.Payload, &ddpkt); err != nil {
|
if err := ddp.ExtUnmarshal(ethFrame.Payload, &ddpkt); err != nil {
|
||||||
log.Printf("Couldn't unmarshal DDP packet: %v", err)
|
log.Printf("Couldn't unmarshal DDP packet: %v", err)
|
||||||
|
|
6
rtmp.go
6
rtmp.go
|
@ -60,7 +60,8 @@ func (m *RTMPMachine) Run(ctx context.Context) error {
|
||||||
ddpPkt := ddp.ExtPacket{
|
ddpPkt := ddp.ExtPacket{
|
||||||
ExtHeader: ddp.ExtHeader{
|
ExtHeader: ddp.ExtHeader{
|
||||||
Size: uint16(len(dataPktRaw)),
|
Size: uint16(len(dataPktRaw)),
|
||||||
DstNet: 0,
|
Cksum: 0,
|
||||||
|
DstNet: 0, // this network
|
||||||
DstNode: 0xff, // broadcast packet
|
DstNode: 0xff, // broadcast packet
|
||||||
DstSocket: 1, // the special RTMP socket
|
DstSocket: 1, // the special RTMP socket
|
||||||
SrcNet: myAddr.Proto.Network,
|
SrcNet: myAddr.Proto.Network,
|
||||||
|
@ -71,10 +72,11 @@ func (m *RTMPMachine) Run(ctx context.Context) error {
|
||||||
Data: dataPktRaw,
|
Data: dataPktRaw,
|
||||||
}
|
}
|
||||||
|
|
||||||
ethFrame, err := ethertalk.AppleTalk(ethertalk.AppleTalkBroadcast, ddpPkt)
|
ethFrame, err := ethertalk.AppleTalk(myAddr.Hardware, ddpPkt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("RTMP: Couldn't create EtherTalk frame: %v", err)
|
log.Printf("RTMP: Couldn't create EtherTalk frame: %v", err)
|
||||||
}
|
}
|
||||||
|
ethFrame.Dst = ethertalk.AppleTalkBroadcast
|
||||||
|
|
||||||
ethFrameRaw, err := ethertalk.Marshal(*ethFrame)
|
ethFrameRaw, err := ethertalk.Marshal(*ethFrame)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue