bump golangci-lint (#784)

This commit is contained in:
Alessandro Ros
2025-05-23 14:51:33 +02:00
committed by GitHub
parent 2694ed941f
commit b1804d77e8
72 changed files with 289 additions and 211 deletions

View File

@@ -2,14 +2,12 @@ package main
import (
"crypto/rand"
"fmt"
"log"
"time"
"github.com/bluenviron/gortsplib/v4"
"github.com/bluenviron/gortsplib/v4/pkg/format"
"github.com/bluenviron/mediacommon/v2/pkg/codecs/g711"
"github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts"
)
func multiplyAndDivide(v, m, d int64) int64 {
@@ -27,15 +25,6 @@ func randUint32() (uint32, error) {
return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3]), nil
}
func findTrack(r *mpegts.Reader) (*mpegts.Track, error) {
for _, track := range r.Tracks() {
if _, ok := track.Codec.(*mpegts.CodecH264); ok {
return track, nil
}
}
return nil, fmt.Errorf("H264 track not found")
}
type audioStreamer struct {
stream *gortsplib.ServerStream
}
@@ -68,7 +57,8 @@ func (r *audioStreamer) run() {
for range ticker.C {
// get current timestamp
pts := multiplyAndDivide(int64(time.Since(start)), int64(r.stream.Desc.Medias[0].Formats[0].ClockRate()), int64(time.Second))
pts := multiplyAndDivide(int64(time.Since(start)),
int64(r.stream.Desc.Medias[0].Formats[0].ClockRate()), int64(time.Second))
// generate dummy LPCM audio samples
samples := createDummyAudio(pts, prevPTS)
@@ -98,6 +88,5 @@ func (r *audioStreamer) run() {
}
prevPTS = pts
}
}