[Gambas-user] MediaPlayer bug with AboutToFinish and URL?

Benoît Minisini gambas at ...1...
Sun Oct 9 03:28:44 CEST 2016


Le 09/10/2016 à 01:34, Piper984 a écrit :
> Hi Benoît: Posting again without 'html' boxed clicked. Whoops.
>
>
> I have been playing with the Gambas MediaPlayer and the related Gambas
> wrappers of GStreamer libs recently hoping that I can find enough
> functionality in the gb.media libraries to be able to construct my app and
> not have to ever go back to doing my GUIs in C.
>
> I have used the Playbin plugin in the past w/ PyGST and also C.  When the
> video is about done playing an event can fire that lets the hosting
> application set the URL property to a new video should the app want to play
> another video at the end of the current video.
>
> I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I looked at the C
> code here
> https://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.c
> and see that for the most part the MediaPlayer is a very slick wrapper of
> the Playbin element.  So hopefully the issue will be easy to find / correct
> for someone with some deeper background of the gb.media library.

On the contrary, as gb.media is just a thin wrapper, the bug will be 
hard to fix, if it can be fixed!

As for the AboutToFinish event, the corresponding glib signal is not 
raised in the main thread. So, as Gambas is single-threaded, the signal 
is postponed to the main thread to be raised as a Gambas event. As far 
as I know, this is the only logic difference with a program written in C!

>
> The issues:
>
> #1) Even though the "AboutToFinish" event fires successfully, setting the
> URL makes no effect here, and the "END" event will then fire at the end of
> the current video. The 'Video_Changed' event does not fire.  If after
> starting starting a video, I manually change the .URL property (from a
> button click event) then at the end of the first video I will get a
> 'Video_Changed' event and the second video will start.

I have done a simple test on my system: setting the URL during 
AboutToFinish... completely freezes the process. I will try to know what 
happens.

>
> #2) When I am able to get the MediaPlayer to set the .URL property to the
> second value, and the video does start to play at the end of the first
> video, the audio plays but the video does not update until I invoke the
> .Pause() method and even then it's just displays that frame and when I
> invoke .Play() after  .Pause() the video does not continue but the audio
> does.  Codec issue?

Maybe. GStreamer is a very sensitive animal.


-- 
Benoît Minisini




More information about the User mailing list