summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Swain <robert.swain@collabora.co.uk>2011-09-26 17:23:41 +0200
committerRobert Swain <robert.swain@collabora.co.uk>2011-09-26 17:23:41 +0200
commitf4e744ff4921bef432b40128bdd0b33786e44732 (patch)
tree952092af93d0606fd14fdde31fdad85c9ed58f85
parentfc2434fd97fee9cae4a32f4e2865e044fcf5b679 (diff)
camerabin2: Stop the audio source between captures
Move the audio source setting of state to NULL to _stop_capture () to avoid the audio source running between captures.
-rw-r--r--gst/camerabin2/gstcamerabin2.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index d55dd5c2a..5a227138e 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -380,11 +380,6 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin)
if (camerabin->audio_src) {
GstClock *clock = gst_pipeline_get_clock (GST_PIPELINE_CAST (camerabin));
- /* FIXME We need to set audiosrc to null to make it resync the ringbuffer
- * while bug https://bugzilla.gnome.org/show_bug.cgi?id=648359 isn't
- * fixed */
- gst_element_set_state (camerabin->audio_src, GST_STATE_NULL);
-
/* need to reset eos status (pads could be flushing) */
gst_element_set_state (camerabin->audio_capsfilter, GST_STATE_READY);
gst_element_set_state (camerabin->audio_volume, GST_STATE_READY);
@@ -452,6 +447,14 @@ gst_camera_bin_stop_capture (GstCameraBin2 * camerabin)
if (camerabin->mode == MODE_VIDEO && camerabin->audio_src) {
camerabin->audio_drop_eos = FALSE;
gst_element_send_event (camerabin->audio_src, gst_event_new_eos ());
+
+ /* FIXME We need to set audiosrc to null to make it resync the ringbuffer
+ * while bug https://bugzilla.gnome.org/show_bug.cgi?id=648359 isn't
+ * fixed.
+ *
+ * Also, we set to NULL here to stop capturing audio through to the next
+ * video mode start capture. */
+ gst_element_set_state (camerabin->audio_src, GST_STATE_NULL);
}
}