[Gambas-user] gb.media - Pipelines with local declarations don't work

Claus Dietrich claus.dietrich at freenet.de
Mon Jan 15 10:34:28 CET 2024


I found that gb.media-pipelines with local declarations don't work on 
V3.18.4 and the master. Here an example which doesn't show any error but 
doesn't produce the expected default 440 Hz output tone:

Public Sub Form_Open()

   Dim pl As MediaPipeline
   Dim src As MediaControl
   Dim cnv As MediaControl
   Dim snk As MediaControl

   pl = New MediaPipeline
   src = New MediaControl(pl, "audiotestsrc")
   cnv = New MediaControl(pl, "audioconvert")
   snk = New MediaControl(pl, "autoaudiosink")

   src.LinkTo(cnv)
   cnv.LinkTo(snk)

   pl.play

End

When I change declarations to Private the pipeline works:

Private pl As MediaPipeline
Private src As MediaControl
Private cnv As MediaControl
Private snk As MediaControl

Public Sub Form_Open()

   pl = New MediaPipeline
   src = New MediaControl(pl, "audiotestsrc")
   cnv = New MediaControl(pl, "audioconvert")
   snk = New MediaControl(pl, "autoaudiosink")

   src.LinkTo(cnv)
   cnv.LinkTo(snk)

   pl.play

End

I tried another pipeline with the same result. Is there a reason for 
that or is it possibly a bug?

Best regards

Claus



More information about the User mailing list