From 4254090e93c7167aa6937962dafe811b89840729 Mon Sep 17 00:00:00 2001 From: David Thorpe Date: Mon, 29 Jul 2024 17:54:42 +0200 Subject: [PATCH] Updated go-media for nil frames --- go.mod | 10 +++------- pkg/ffmpeg/decoder.go | 7 +++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index bf4d776..c8256be 100755 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/mutablelogic/go-media -go 1.20 +go 1.22 + +toolchain go1.22.3 require ( - github.com/alecthomas/kong v0.9.0 github.com/djthorpe/go-errors v1.0.3 - github.com/djthorpe/go-tablewriter v0.0.8 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/llgcode/draw2d v0.0.0-20240627062922-0ed1ff131195 github.com/mutablelogic/go-client v1.0.8 @@ -16,11 +16,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.7 // indirect golang.org/x/image v0.18.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/ffmpeg/decoder.go b/pkg/ffmpeg/decoder.go index d92f4b2..40e2bb7 100644 --- a/pkg/ffmpeg/decoder.go +++ b/pkg/ffmpeg/decoder.go @@ -156,8 +156,11 @@ func (d *Decoder) decode(packet *ff.AVPacket, fn DecoderFrameFn) error { } // Copy across the timebase and pts - (*ff.AVFrame)(dest).SetPts(d.frame.Pts()) - (*ff.AVFrame)(dest).SetTimeBase(d.timeBase) + // TODO if dest != nil { + // fmt.Println("pts=", d.frame.Pts()) + // (*ff.AVFrame)(dest).SetPts(d.frame.Pts()) + // (*ff.AVFrame)(dest).SetTimeBase(d.timeBase) + //} // Pass back to the caller if err := fn(d.stream, dest); errors.Is(err, io.EOF) {