summaryrefslogtreecommitdiff
path: root/gst/camerabin2
diff options
context:
space:
mode:
authorRobert Swain <robert.swain@collabora.co.uk>2011-09-29 16:22:00 +0200
committerRobert Swain <robert.swain@collabora.co.uk>2011-09-29 16:22:00 +0200
commit6446cc4ae941775475d794928ebe5fe2b4c52600 (patch)
tree8ca3413ad28a082cfb1fa1bb9338e5e089ef66b6 /gst/camerabin2
parentf4e744ff4921bef432b40128bdd0b33786e44732 (diff)
downloadgstreamer-plugins-bad-6446cc4ae941775475d794928ebe5fe2b4c52600.tar.gz
camerabin2: Fix potential loss of EOS event
Setting the audio source to NULL just after pushing the EOS event on it could potentially cause loss of said EOS event. Instead, we can set the audio source to NULL when ready-for-capture is signalled and the boolean value is true as this indicates we are not currently capturing video.
Diffstat (limited to 'gst/camerabin2')
-rw-r--r--gst/camerabin2/gstcamerabin2.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 5a227138e..e990a9508 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -447,14 +447,6 @@ 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);
}
}
@@ -503,7 +495,16 @@ gst_camera_bin_src_notify_readyforcapture (GObject * obj, GParamSpec * pspec,
gst_element_set_state (camera->video_encodebin, GST_STATE_PLAYING);
gst_element_set_state (camera->videobin_capsfilter, GST_STATE_PLAYING);
}
-
+ } else {
+ if (camera->mode == MODE_VIDEO && camera->audio_src) {
+ /* 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 and to clear EOS. */
+ gst_element_set_state (camera->audio_src, GST_STATE_NULL);
+ }
}
}