chore: update module avformat to v0.0.2

This commit is contained in:
ydajiang
2025-08-08 17:48:54 +08:00
parent ca52588bae
commit d7ad1dc725
4 changed files with 7 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ func (d *Demuxer) Input(data []byte) (int, error) {
for i := 0; i < length; {
n := bufio.MinInt(length-i, 320)
_, _ = d.DataPipeline.Write(data[i:i+n], 0, utils.AVMediaTypeAudio)
pkt, _ := d.DataPipeline.Feat(0)
pkt, _ := d.DataPipeline.Fetch(0)
d.OnAudioPacket(0, utils.AVCodecIdPCMALAW, pkt, d.ts)
d.ts += int64(n)
i += n

8
go.mod
View File

@@ -2,10 +2,10 @@ module github.com/lkmio/lkm
require (
github.com/lkmio/audio-transcoder v0.2.1
github.com/lkmio/avformat v0.0.1
github.com/lkmio/flv v0.0.2
github.com/lkmio/mpeg v0.0.3
github.com/lkmio/rtmp v0.0.2
github.com/lkmio/avformat v0.0.2
github.com/lkmio/flv v0.0.3
github.com/lkmio/mpeg v0.0.4
github.com/lkmio/rtmp v0.0.3
github.com/lkmio/rtp v0.0.2
github.com/lkmio/transport v0.0.1
)

View File

@@ -17,7 +17,7 @@ type Demuxer struct {
func (d *Demuxer) ProcessPrevPacket() error {
var codec utils.AVCodecID
index := d.FindBufferIndex(int(d.prevPacket.pt))
bytes, err := d.BaseDemuxer.DataPipeline.Feat(index)
bytes, err := d.BaseDemuxer.DataPipeline.Fetch(index)
if err != nil {
return err
} else /*if d.prevPacket.packetType > AudioFrameMark {

View File

@@ -102,7 +102,7 @@ func (m *mergeWritingBuffer) alloc(size int, ts int64, videoPkt, videoKey bool)
func (m *mergeWritingBuffer) FlushSegment() (*collections.ReferenceCounter[[]byte], bool) {
buffer := m.buffers.Peek(m.buffers.Size() - 1)
data := buffer.buffer.Feat()
data := buffer.buffer.Fetch()
if len(data) == 0 {
return nil, false
}