From 8098a2f0b26b10c8cb611d634190532d2b2a9aed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 4 Jul 2012 18:58:46 +0100 Subject: [PATCH] imagefreeze: clear 0 DTS on buffers output, as sinks will prefer DTS over PTS for syncing Since the initial decoded still image buffer will have dts=pts=0, and we only set PTS on buffers we push out, all buffers pushed out would have a DTS of 0. Sinks, however, will prefer DTS over PTS if both are set, and will therefore always see a timestamp of 0 no matter what the PTS is set to. Fixes unit test too. --- gst/imagefreeze/gstimagefreeze.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c index b219be7..34041e0 100644 --- a/gst/imagefreeze/gstimagefreeze.c +++ b/gst/imagefreeze/gstimagefreeze.c @@ -714,7 +714,7 @@ gst_image_freeze_src_loop (GstPad * pad) if (self->need_segment) { GstEvent *e; - GST_DEBUG_OBJECT (pad, "Pushing NEWSEGMENT event: %" GST_SEGMENT_FORMAT, + GST_DEBUG_OBJECT (pad, "Pushing SEGMENT event: %" GST_SEGMENT_FORMAT, &self->segment); e = gst_event_new_segment (&self->segment); @@ -777,7 +777,8 @@ gst_image_freeze_src_loop (GstPad * pad) if (in_seg) { GstFlowReturn ret; - GST_BUFFER_TIMESTAMP (buffer) = cstart; + GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE; + GST_BUFFER_PTS (buffer) = cstart; GST_BUFFER_DURATION (buffer) = cstop - cstart; GST_BUFFER_OFFSET (buffer) = offset; GST_BUFFER_OFFSET_END (buffer) = offset + 1; -- 2.7.4