mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 03:25:52 +08:00
bump golangci-lint (#784)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Package main contains an example.
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
|
||||
"github.com/bluenviron/gortsplib/v4"
|
||||
@@ -91,18 +93,18 @@ func main() {
|
||||
}
|
||||
|
||||
// extract access unit from RTP packets
|
||||
au, err := h264RTPDec.Decode(pkt)
|
||||
if err != nil {
|
||||
if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded {
|
||||
log.Printf("ERR: %v", err)
|
||||
au, err2 := h264RTPDec.Decode(pkt)
|
||||
if err2 != nil {
|
||||
if !errors.Is(err2, rtph264.ErrNonStartingPacketAndNoPrevious) && !errors.Is(err2, rtph264.ErrMorePacketsNeeded) {
|
||||
log.Printf("ERR: %v", err2)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// encode the access unit into MPEG-TS
|
||||
err = mpegtsMuxer.writeH264(au, pts)
|
||||
if err != nil {
|
||||
log.Printf("ERR: %v", err)
|
||||
err2 = mpegtsMuxer.writeH264(au, pts)
|
||||
if err2 != nil {
|
||||
log.Printf("ERR: %v", err2)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -119,16 +121,16 @@ func main() {
|
||||
}
|
||||
|
||||
// extract access units from RTP packets
|
||||
aus, err := mpeg4AudioRTPDec.Decode(pkt)
|
||||
if err != nil {
|
||||
log.Printf("ERR: %v", err)
|
||||
aus, err2 := mpeg4AudioRTPDec.Decode(pkt)
|
||||
if err2 != nil {
|
||||
log.Printf("ERR: %v", err2)
|
||||
return
|
||||
}
|
||||
|
||||
// encode access units into MPEG-TS
|
||||
err = mpegtsMuxer.writeMPEG4Audio(aus, pts)
|
||||
if err != nil {
|
||||
log.Printf("ERR: %v", err)
|
||||
err2 = mpegtsMuxer.writeMPEG4Audio(aus, pts)
|
||||
if err2 != nil {
|
||||
log.Printf("ERR: %v", err2)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user