[gst-devel] Fwd: trouble seeking in local files

Edward Hervey bilboed at gmail.com
Sun Aug 17 11:15:54 CEST 2008


Hi,


On Sat, 2008-08-16 at 08:14 -0400, Soren Harward wrote:
> On Saturday 16 August 2008 4:13:30 Edward Hervey wrote:
> >   You are not waiting for the confirmation that your pipeline has
> > properly pre-rolled (reached the PAUSED state). Simply put, Seeks can
> > only work when the pipeline is either in the PAUSED or PLAYING state.
> >
> > You should wait for the GST_MESSAGE_STATE_CHANGED message on the bus
> > from the pipeline stating it has successfully changed state to PAUSED
> > before sending that seek.
> 
> Thanks.  Adding an event loop which calls gst_element_get_state and waits for 
> it to return GST_STATE_PAUSED also seems to work.  Is one way better than the 
> other?
> 

You just run the risk that if an error is emitted in that state
transition... it will hang (until the timeout you specified...).
GStreamer is designed to be used asynchronously (send instructions and
receive feedback either via signals, or mainly via bus messages).

You can simulate that asynchronous behaviour by creating a state machine
around you bus polling (when you see a certain message, do a certain
action, when you see an EOS/ERROR you exit, etc...).

 Edward





More information about the gstreamer-devel mailing list