[gst-devel] How to flush a bus when removing an element from a pipeline?

Edward Hervey bilboed at gmail.com
Fri Apr 23 09:29:02 CEST 2010


On Thu, 2010-04-22 at 22:52 -0800, wl2776 wrote:
> My application adds an uridecodebin instance to the pipeline, and then
> removes it, if the element doesn't go to the paused state (this can happen,
> if a non-media file was supplied to the uridecodebin) and returns
> GST_STATE_CHANGE_FAILURE.
> 
> I call 
> gst_object_unref(uridecodebin_inst);
> uridecodebin_inst=NULL;
> after the removal.

  Have you set uridecodebin to NULL before removing it ? Have you made
sure it didn't connect to anything ? Did you hold an extra reference to
uridecodebin before adding it to the pipeline (if not, the pipeline
*stole* your reference and you shouldn't have to unref it after removing
it from the pipeline).

> 
> And the problem is that my application sometimes crashes with the system
> error message saying, it attempted writing to the location 0x0000010. Or,
> the location 0xfeeefef6. 
> I am using MS Visual Studio 2008, and the latter address is very close to
> the 0xfeeefeee - the value, CRT fills the just released memory.
> Call stack is useless, it contains only some addresses in the GLib DLL and
> in windows system libraries.

  Those addresses are really useful... *NOT* ! 

> 
> I suspect, this is because the bus contains some messages related to the
> recently removed uridecodebin.

  Most likely due to the double-unreferencing I explained above.

> 
> How can I flush these messages or wait for finishing of all threads, related
> to the element removal? 
> 






More information about the gstreamer-devel mailing list