From 26553bfb1dba0083599e7dc7b5743a8834d60859 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Wed, 13 Apr 2011 22:33:37 -0300 Subject: [PATCH] camerabin: Preserve unused imagebin or videobin on NULL If video or image mode is never selected then respective bin is in NULL state. Preserve this state when resetting camerabin from PAUSED to READY. --- gst/camerabin/gstcamerabin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 7070903b40..99b1b54d18 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -3851,8 +3851,12 @@ gst_camerabin_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_READY: /* all processing should stop and those elements could have their state * locked, so set them explicitly here */ - gst_element_set_state (camera->imgbin, GST_STATE_READY); - gst_element_set_state (camera->vidbin, GST_STATE_READY); + if (GST_STATE (camera->imgbin) != GST_STATE_NULL) { + gst_element_set_state (camera->imgbin, GST_STATE_READY); + } + if (GST_STATE (camera->vidbin) != GST_STATE_NULL) { + gst_element_set_state (camera->vidbin, GST_STATE_READY); + } break; case GST_STATE_CHANGE_READY_TO_NULL: gst_element_set_locked_state (camera->imgbin, FALSE);