static gboolean
gst_jpeg_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
{
- GstBufferPool *pool;
+ GstBufferPool *pool = NULL;
GstStructure *config;
if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (bdec, query))
return FALSE;
- g_assert (gst_query_get_n_allocation_pools (query) > 0);
- gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
- g_assert (pool != NULL);
+ if (gst_query_get_n_allocation_pools (query) > 0)
+ gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
+
+ if (pool == NULL)
+ return FALSE;
config = gst_buffer_pool_get_config (pool);
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) {
static gboolean
gst_pngdec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
{
- GstBufferPool *pool;
+ GstBufferPool *pool = NULL;
GstStructure *config;
if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (bdec, query))
return FALSE;
- g_assert (gst_query_get_n_allocation_pools (query) > 0);
- gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
- g_assert (pool != NULL);
+ if (gst_query_get_n_allocation_pools (query) > 0)
+ gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
+
+ if (pool == NULL)
+ return FALSE;
config = gst_buffer_pool_get_config (pool);
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) {
gst_task_join (qtmr->task);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
- g_assert (gst_task_get_state (qtmr->task) == GST_TASK_STOPPED);
+ if (gst_task_get_state (qtmr->task) != GST_TASK_STOPPED)
+ GST_ERROR ("task %p should be stopped by now", qtmr->task);
gst_object_unref (qtmr->task);
qtmr->task = NULL;
g_rec_mutex_clear (&qtmr->task_mutex);
main (int argc, char **argv)
{
GstElement *pipeline;
-#ifndef G_DISABLE_ASSERT
- GstState state, pending;
-#endif
+ GstState state;
GError *error = NULL;
gst_init (&argc, &argv);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* lets check it gets to PLAYING */
- g_assert (gst_element_get_state (pipeline, &state, &pending,
- GST_CLOCK_TIME_NONE) != GST_STATE_CHANGE_FAILURE);
- g_assert (state == GST_STATE_PLAYING || pending == GST_STATE_PLAYING);
+ if (gst_element_get_state (pipeline, &state, NULL,
+ GST_CLOCK_TIME_NONE) == GST_STATE_CHANGE_FAILURE ||
+ state != GST_STATE_PLAYING) {
+ g_warning ("State change to playing failed");
+ }
/* We want to get out after 5 seconds */
g_timeout_add (5000, (GSourceFunc) terminate_playback, pipeline);