mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 15:42:52 +08:00
cleanup decodebin example
This commit is contained in:
@@ -135,8 +135,11 @@ func handleMessage(msg *gst.Message) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func runPipeline(pipeline *gst.Pipeline) error {
|
||||
func runPipeline(loop *gst.MainLoop, pipeline *gst.Pipeline) error {
|
||||
defer loop.Quit()
|
||||
|
||||
pipeline.SetState(gst.StatePlaying)
|
||||
defer pipeline.Destroy()
|
||||
|
||||
bus := pipeline.GetPipelineBus()
|
||||
|
||||
@@ -165,6 +168,6 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return runPipeline(pipeline)
|
||||
return runPipeline(loop, pipeline)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user