mirror of
https://github.com/lkmio/lkm.git
synced 2025-09-27 03:26:01 +08:00
chore: update module avformat to v0.0.2
This commit is contained in:
@@ -33,7 +33,7 @@ func (d *Demuxer) Input(data []byte) (int, error) {
|
|||||||
for i := 0; i < length; {
|
for i := 0; i < length; {
|
||||||
n := bufio.MinInt(length-i, 320)
|
n := bufio.MinInt(length-i, 320)
|
||||||
_, _ = d.DataPipeline.Write(data[i:i+n], 0, utils.AVMediaTypeAudio)
|
_, _ = 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.OnAudioPacket(0, utils.AVCodecIdPCMALAW, pkt, d.ts)
|
||||||
d.ts += int64(n)
|
d.ts += int64(n)
|
||||||
i += n
|
i += n
|
||||||
|
8
go.mod
8
go.mod
@@ -2,10 +2,10 @@ module github.com/lkmio/lkm
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/lkmio/audio-transcoder v0.2.1
|
github.com/lkmio/audio-transcoder v0.2.1
|
||||||
github.com/lkmio/avformat v0.0.1
|
github.com/lkmio/avformat v0.0.2
|
||||||
github.com/lkmio/flv v0.0.2
|
github.com/lkmio/flv v0.0.3
|
||||||
github.com/lkmio/mpeg v0.0.3
|
github.com/lkmio/mpeg v0.0.4
|
||||||
github.com/lkmio/rtmp v0.0.2
|
github.com/lkmio/rtmp v0.0.3
|
||||||
github.com/lkmio/rtp v0.0.2
|
github.com/lkmio/rtp v0.0.2
|
||||||
github.com/lkmio/transport v0.0.1
|
github.com/lkmio/transport v0.0.1
|
||||||
)
|
)
|
||||||
|
@@ -17,7 +17,7 @@ type Demuxer struct {
|
|||||||
func (d *Demuxer) ProcessPrevPacket() error {
|
func (d *Demuxer) ProcessPrevPacket() error {
|
||||||
var codec utils.AVCodecID
|
var codec utils.AVCodecID
|
||||||
index := d.FindBufferIndex(int(d.prevPacket.pt))
|
index := d.FindBufferIndex(int(d.prevPacket.pt))
|
||||||
bytes, err := d.BaseDemuxer.DataPipeline.Feat(index)
|
bytes, err := d.BaseDemuxer.DataPipeline.Fetch(index)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else /*if d.prevPacket.packetType > AudioFrameMark {
|
} else /*if d.prevPacket.packetType > AudioFrameMark {
|
||||||
|
@@ -102,7 +102,7 @@ func (m *mergeWritingBuffer) alloc(size int, ts int64, videoPkt, videoKey bool)
|
|||||||
|
|
||||||
func (m *mergeWritingBuffer) FlushSegment() (*collections.ReferenceCounter[[]byte], bool) {
|
func (m *mergeWritingBuffer) FlushSegment() (*collections.ReferenceCounter[[]byte], bool) {
|
||||||
buffer := m.buffers.Peek(m.buffers.Size() - 1)
|
buffer := m.buffers.Peek(m.buffers.Size() - 1)
|
||||||
data := buffer.buffer.Feat()
|
data := buffer.buffer.Fetch()
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user