Commit b4c1c1c6 authored by Julien Moutte's avatar Julien Moutte
Browse files

sys/: Playbin keeps some ref to some frames. We might get a frame destroyed after changing state to

Original commit message from CVS:
2006-01-22  Julien MOUTTE  <julien@moutte.net>

* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimagesink_buffer_alloc): Playbin keeps some ref to some
frames. We might get a frame destroyed after changing state to
NULL, adding a safety check on xcontext.
parent 47575067
2006-01-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimagesink_buffer_alloc): Playbin keeps some ref to some
frames. We might get a frame destroyed after changing state to
NULL, adding a safety check on xcontext.
2006-01-22 Tim-Philipp Müller <tim at centricular dot net>
 
* gst-libs/gst/interfaces/xoverlay.c:
......
......@@ -485,6 +485,11 @@ gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
ximagesink->cur_image = NULL;
}
/* We might have some buffers destroyed after changing state to NULL */
if (!ximagesink->xcontext) {
goto beach;
}
g_mutex_lock (ximagesink->x_lock);
#ifdef HAVE_XSHM
......@@ -511,6 +516,7 @@ gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
g_mutex_unlock (ximagesink->x_lock);
beach:
if (ximage->ximagesink) {
/* Release the ref to our sink */
ximage->ximagesink = NULL;
......
......@@ -223,6 +223,11 @@ gst_xvimage_buffer_destroy (GstXvImageBuffer * xvimage)
if (xvimagesink->cur_image == xvimage)
xvimagesink->cur_image = NULL;
/* We might have some buffers destroyed after changing state to NULL */
if (xvimagesink->xcontext) {
goto beach;
}
g_mutex_lock (xvimagesink->x_lock);
#ifdef HAVE_XSHM
......@@ -251,6 +256,7 @@ gst_xvimage_buffer_destroy (GstXvImageBuffer * xvimage)
g_mutex_unlock (xvimagesink->x_lock);
beach:
xvimage->xvimagesink = NULL;
gst_object_unref (xvimagesink);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment