From 07279bac7b2271439d0ef201264400a3ff4c0ff9 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 28 Dec 2010 17:16:05 -0300 Subject: [PATCH] camerabin: mode can be only image or video No need to check if camerabin is on video mode if it isn't on image mode as those are the only 2 modes available. Additionally, if mode gets corrupted somehow and would be neither image or video it would cause a null pointer dereferencing some lines of code below, so this is safer. --- gst/camerabin/gstcamerabin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index f759923169..e7f13dae8f 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -3520,7 +3520,7 @@ gst_camerabin_set_property (GObject * object, guint prop_id, prev_pipe = &camera->preview_pipeline; preview_source_filter = &camera->app_preview_source_filter; prev_caps = &camera->preview_caps; - } else if (camera->mode == MODE_VIDEO) { + } else { /* MODE VIDEO */ prev_pipe = &camera->video_preview_pipeline; preview_source_filter = &camera->app_video_preview_source_filter; prev_caps = &camera->video_preview_caps; @@ -3562,7 +3562,7 @@ gst_camerabin_set_property (GObject * object, guint prop_id, preview_pipe = &camera->preview_pipeline; preview_source_filter = &camera->app_preview_source_filter; preview_caps = camera->preview_caps; - } else if (camera->mode == MODE_VIDEO) { + } else { /* MODE VIDEO */ preview_pipe = &camera->video_preview_pipeline; preview_source_filter = &camera->app_video_preview_source_filter; preview_caps = camera->video_preview_caps; -- 2.34.1