videoencoder: clip input buffers to current input segment
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 25 Sep 2012 15:19:15 +0000 (17:19 +0200)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 25 Sep 2012 15:19:15 +0000 (17:19 +0200)
... rather than to output segment, which will only be set
to current input segment if some output is produced
(coming from non-clipped input).

Also fixup debug message.

gst-libs/gst/video/gstvideoencoder.c

index d8a5ec2..2fa0af8 100644 (file)
@@ -1259,7 +1259,7 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
 
   GST_LOG_OBJECT (encoder,
       "received buffer of size %" G_GSIZE_FORMAT " with PTS %" GST_TIME_FORMAT
-      ", PTS %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT,
+      ", DTS %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT,
       gst_buffer_get_size (buf), GST_TIME_ARGS (pts), GST_TIME_ARGS (dts),
       GST_TIME_ARGS (duration));
 
@@ -1275,7 +1275,7 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
     stop = GST_CLOCK_TIME_NONE;
 
   /* Drop buffers outside of segment */
-  if (!gst_segment_clip (&encoder->output_segment,
+  if (!gst_segment_clip (&encoder->input_segment,
           GST_FORMAT_TIME, start, stop, &cstart, &cstop)) {
     GST_DEBUG_OBJECT (encoder, "clipping to segment dropped frame");
     gst_buffer_unref (buf);