ext/directfb/dfbvideosink.c: Don't try allocating if we are not setup yet. Fail changing state if setup fails.

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

* ext/directfb/dfbvideosink.c: (gst_dfbvideosink_change_state),
(gst_dfbvideosink_buffer_alloc): Don't try allocating if we are
not
setup yet. Fail changing state if setup fails.
This commit is contained in:
Julien Moutte 2006-07-31 16:50:27 +00:00
parent f186c1b29c
commit f91baadfcd
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2006-07-31 Julien MOUTTE <julien@moutte.net>
* ext/directfb/dfbvideosink.c: (gst_dfbvideosink_change_state),
(gst_dfbvideosink_buffer_alloc): Don't try allocating if we are not
setup yet. Fail changing state if setup fails.
2006-07-31 Wim Taymans <wim@fluendo.com> 2006-07-31 Wim Taymans <wim@fluendo.com>
* gst/gdp/gstgdpdepay.c: (gst_gdp_depay_init), * gst/gdp/gstgdpdepay.c: (gst_gdp_depay_init),

View file

@ -1425,7 +1425,11 @@ gst_dfbvideosink_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
dfbvideosink->running = TRUE; dfbvideosink->running = TRUE;
if (!dfbvideosink->setup) { if (!dfbvideosink->setup) {
gst_dfbvideosink_setup (dfbvideosink); if (!gst_dfbvideosink_setup (dfbvideosink)) {
GST_DEBUG_OBJECT (dfbvideosink, "setup failed when changing state "
"from NULL to READY");
return GST_STATE_CHANGE_FAILURE;
}
} }
break; break;
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
@ -1697,6 +1701,12 @@ gst_dfbvideosink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
GST_DEBUG_OBJECT (dfbvideosink, "a buffer of %d bytes was requested " GST_DEBUG_OBJECT (dfbvideosink, "a buffer of %d bytes was requested "
"with caps %" GST_PTR_FORMAT " and offset %llu", size, caps, offset); "with caps %" GST_PTR_FORMAT " and offset %llu", size, caps, offset);
if (G_UNLIKELY (!dfbvideosink->setup)) {
GST_DEBUG_OBJECT (dfbvideosink, "we are not setup yet, can't allocate!");
*buf = NULL;
return ret;
}
desired_caps = gst_caps_copy (caps); desired_caps = gst_caps_copy (caps);
structure = gst_caps_get_structure (desired_caps, 0); structure = gst_caps_get_structure (desired_caps, 0);