summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-01-24 17:46:49 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-01-24 18:05:20 -0300
commita791f5070cdc1b29c4c0415c2c74cf8d6d5ced65 (patch)
tree1330f9dfa78a8d0e6fd5a7ef87c3d063dba54caf
parentc3d05d6006ed78d0d470ab7bbe9436fd43c60d5e (diff)
wrappercamerabinsrc: Check the start time of buffers
Be careful when trying to create a newsegment event to avoid start times of -1 from invalid buffer timestamps
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 9437b9ac1..faac60b4f 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -217,10 +217,15 @@ gst_wrapper_camera_bin_src_vidsrc_probe (GstPad * pad, GstBuffer * buffer,
if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_DONE) {
/* NOP */
} else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
+ gint64 start = 0;
+
+ if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)))
+ start = GST_BUFFER_TIMESTAMP (buffer);
+
/* send the newseg */
GST_DEBUG_OBJECT (self, "Starting video recording, pushing newsegment");
gst_pad_push_event (pad, gst_event_new_new_segment (FALSE, 1.0,
- GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (buffer), -1, 0));
+ GST_FORMAT_TIME, start, -1, 0));
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_RUNNING;
/* post preview */