replace new() with initialize() (#490)

This commit is contained in:
Alessandro Ros
2023-12-26 12:48:35 +01:00
committed by GitHub
parent e77b281395
commit 2d0c530d97
37 changed files with 464 additions and 521 deletions

View File

@@ -50,7 +50,10 @@ func main() {
}
// setup MPEG-4 audio -> MPEG-TS muxer
mpegtsMuxer, err := newMPEGTSMuxer(forma.Config)
mpegtsMuxer := &mpegtsMuxer{
config: forma.Config,
}
mpegtsMuxer.initialize()
if err != nil {
panic(err)
}
@@ -78,7 +81,7 @@ func main() {
}
// encode access units into MPEG-TS
err = mpegtsMuxer.encode(aus, pts)
err = mpegtsMuxer.writeMPEG4Audio(aus, pts)
if err != nil {
log.Printf("ERR: %v", err)
return