mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
format: fix compatibility with some TP-Link cameras (#174)
https://github.com/aler9/rtsp-simple-server/issues/1267
This commit is contained in:
@@ -54,6 +54,16 @@ type Format interface {
|
||||
|
||||
// Unmarshal decodes a format from a media description.
|
||||
func Unmarshal(md *psdp.MediaDescription, payloadTypeStr string) (Format, error) {
|
||||
if payloadTypeStr == "smart/1/90000" {
|
||||
attr, ok := md.Attribute("rtpmap")
|
||||
if ok {
|
||||
i := strings.Index(attr, " TP-LINK/90000")
|
||||
if i >= 0 {
|
||||
payloadTypeStr = attr[:i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tmp, err := strconv.ParseInt(payloadTypeStr, 10, 8)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user