Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if n > 0 {
- var buffer2 []byte = buffer[0:n]
- var buffer3 []byte = buffer2[2:4]
- if len(buffer2) > 0 {
- if !atemIDSet {
- if len(atemID) == 0 {
- log.Println("ATEM ID is empty")
- atemID = buffer3
- } else {
- if len(atemID) == len(buffer3) {
- log.Println("Captured ATEM ID, setting now")
- var idOK bool = true
- for i := range atemID {
- idOK = atemID[i] == buffer3[i]
- }
- if idOK {
- atemIDSet = true
- // set atemIDSet to true, check again later
- }
- }
- }
- }
- // debug
- /*log.Println("Dobil podatke :)")
- lepbuffer := hex.EncodeToString(buffer3)
- log.Println(lepbuffer)*/
- }
- /*if atemIDSet && len(atemID) == 2 {
- log.Println("Spoofed ATEM id")
- buffer[2], buffer[3] = atemID[0], atemID[1]
- } else if len(atemID) != 2 {
- log.Println("ATEM ID length mismatch")
- } else {
- // do nothing
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement