Crash sometimes when unreferencing playbin.

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Sep 5 02:38:20 PDT 2013


On Wed, 2013-09-04 at 12:16 -0700, M.Mario wrote:

Hi,

> I am using gstreamer in an application where a lot of HD videos are used,
> and thus it is not possible to have them all loaded in RAM. Because of this
> I am constantly unloading and loading videos. I have 3 concurrent videos
> loaded in RAM, one of those stays always the same, and the other two are the
> ones constantly changing.  Everything seems fine, except that sometimes, the
> application crashes when unreferencing the playbin. Sometimes it happens at
> the first time the unref is called, sometimes it is the second time,
> sometimes it takes a while. I'm at a bit of a loss in here.
> 
> I thought the problem might have to do with some threads still using the
> pipeline at the same time, so I tried using g_thread_yield, with no success.
> 
> I'm using this wrapper for gstreamer:
> https://github.com/cadet/_2RealGStreamerWrapper
> (here is a forum thread with a bit of an explanation for the wrapper and my
> post commenting on this crash:
> https://forum.libcinder.org/topic/new-video-player-solution-2realgstreamerwrapper
> )
> 
> The wrapper has a "Close()" function where it does the appropiate
> unreferencing of stuff, and this is where the playbin is unreferenced and
> where the crash occurs.
> 
> Maybe you guys can help me with this. I don't know what exactly causes it
> since it seems to happen at random times (when doing the unref).

It's hard to debug these kind of issues. Sounds like a refcount issue
somewhere.

If you're running this on a desktop/laptop system, then running it in
valgrind might help (will run much much slower, esp. with HD videos, but
should hopefully run through roughly the same close/open/close logic).

Cheers
 -Tim



More information about the gstreamer-devel mailing list