gst_element_get_state hangs

Stirling Westrup swestrup at gmail.com
Tue May 7 08:36:57 PDT 2013


Most likely the pipeline is getting stuck trying to change state. You want
to ensure that you put in a reasonable timeout for the
gst_element_get_state call. If the call does time out (returns
GST_STATE_CHANGE_FAILURE or GST_STATE_CHANGE_ASYNC) then you should check
the message bus for errors. I use this little function for that:

// Returns true is any messages were found on the bus.
static gboolean message_check
  ( App * app
  )
  { gboolean     ret = FALSE;
    GstBus     * bus = gst_pipeline_get_bus(app->pipeline);
    GstMessage * msg = gst_bus_pop(bus);

    while(msg)
      {
        ret |= bus_message_handler(app,msg);
        gst_message_unref(msg);
        msg = gst_bus_pop(bus);
      }
    gst_object_unref(bus);
    return ret;
  }


On Tue, May 7, 2013 at 9:30 AM, Mohammad-AL.Gmail <
al.mohamed.salim at gmail.com> wrote:

> In my GStreamer (0.10.32) based player, I switch pipeline to PAUSE and
> then switch state to NULL instead of READY after playback of a file is
> finished and then unref the pipeline.****
>
> However, I face a problem, when I play media files in a folder one after
> another:****
>
> ** **
>
> The playback of files goes OK one after another. ****
>
> However once a while the GStreamer hangs when I turn the status of the
> pipeline to GST_STATE_PLAY.****
>
> Creation of playbin2, setting uri, and getting message bus goes  OK. It
> hangs only when state is switch to READY.****
>
> ** **
>
> I am not able to make out which part / element blocks the pipeline. ****
>
> Once this happen, the pipeline becomes non-responsive.****
>
> ** **
>
> Regards,****
>
> Salim****
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>


-- 
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130507/8efe93f4/attachment.html>


More information about the gstreamer-devel mailing list