Loop a file using playbin without artefacts

Arnaud Loonstra arnaud at z25.org
Thu May 21 12:27:13 PDT 2015


On 2015-05-21 20:07, Nicolas Dufresne wrote:
> The following seems a bit awkward to me (I might be missing some
> details). This is how I do it, and how I think it's supposed to work.
>
> 1. Save and set the prerolled state to FALSE
> 2. Set your pipeline to playing state
> 3. When you receive the async-done message
>   * If not prerolled yet
>     3.1 send a flusing segment seek, with the start/stop you want
>     3.2 set the prerolled state to true
> 4. When you receive the segment done message
>   * Send a non-flushing seek, with same start/stop to loop
>
> Remember that a flushing seek will lead to an async done message.
> Ignoring this will lead to an infinite seek loop.
>
> Nicolas
>
> p.s. This method may display the first frame of the media. This can 
> be
> worked around by disabling presentation of the preroll buffer in your
> display sink. Additionally, setting to paused at 1, and to playing at
> 3.3, will ensure there is no race.

I'm a bit lost. How do I even save and set the preroll state to FALSE?
It seems I need to do this on the sink? I'm using the playbin element 
and attaching a glimagesink to it.

Here's the code: 
https://github.com/sphaero/ZOCPApps/blob/zvideo/zvideo/zvideoplayer.py#L139

Rg,

Arnaud


More information about the gstreamer-devel mailing list