client: replace OnWarning with Log (#208)

This commit is contained in:
Alessandro Ros
2023-03-19 18:15:33 +01:00
committed by GitHub
parent 1005b38ec5
commit d369d215c2
5 changed files with 68 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ package gortsplib
import (
"bytes"
"crypto/tls"
"fmt"
"net"
"strings"
"testing"
@@ -1021,7 +1022,8 @@ func TestClientRecordDecodeErrors(t *testing.T) {
v := TransportTCP
return &v
}(),
OnWarning: func(err error) {
Log: func(level LogLevel, format string, args ...interface{}) {
err := fmt.Errorf(format, args...)
switch {
case ca.proto == "udp" && ca.name == "rtcp invalid":
require.EqualError(t, err, "rtcp: packet too short")