From: Julien Moutte Date: Sun, 22 Jan 2006 17:24:02 +0000 (+0000) Subject: sys/: Playbin keeps some ref to some frames. We might get a frame destroyed after... X-Git-Tag: 1.19.3~511^2~12294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4c1c1c61c22d7633fa1431d4e13e61be55ecc5c;p=platform%2Fupstream%2Fgstreamer.git 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 * 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. --- diff --git a/ChangeLog b/ChangeLog index 79f4c55..007453b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-22 Julien MOUTTE + + * 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 * gst-libs/gst/interfaces/xoverlay.c: diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 0e3b779..f0be51c 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.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; diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 85d52ad..b884849 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -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);