From a458f22ae308fcfadc71975a304b644d4e09fae1 Mon Sep 17 00:00:00 2001 From: Sahin Kasap <39086573+sahin52@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:56:26 +0300 Subject: [PATCH] WritePacket method does not return error when the stream is not supported --- format/ts/muxer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format/ts/muxer.go b/format/ts/muxer.go index 53bc6a0..faea462 100644 --- a/format/ts/muxer.go +++ b/format/ts/muxer.go @@ -172,7 +172,8 @@ func (self *Muxer) WritePacket(pkt av.Packet) (err error) { stream, ok := self.streams[int(pkt.Idx)] if !ok { fmt.Printf("Warning, unsupported stream index: %d\n", pkt.Idx) - return + err = fmt.Errorf("Warning, unsupported stream index: %d", pkt.Idx) + return err } pkt.Time += time.Second