<div dir="ltr">Hi,<div><br></div><div>In my plugin, I have a convert function in video sink element which is checking for temporal clipping in the buffer and drops the buffer if buffer duration is outside segment boundaries. Due to temporal clipping, I get choppy audio/video or sometimes no audio for some streams.If I disable this convert function, streams start plying fine.</div>

<div><br></div><div><div>static GstBuffer *</div><div>mds_gst_vidsink_convert (MdsGstElement * mds_element, GstBuffer * buf,</div><div>    gboolean need_seq_hdr)</div><div>{</div><div>  MdsGstVidsink *vidsink = MDS_GST_VIDSINK (mds_element);</div>

<div>  GstBuffer *outbuf = buf;</div><div>  GstClockTime pts, duration;</div><div>  gint64 clip_start, clip_stop;</div><div>  gboolean in_seg;</div><div><br></div><div>  pts = GST_BUFFER_TIMESTAMP (buf);</div><div>  duration = GST_BUFFER_DURATION (buf);</div>

<div>  if (GST_CLOCK_TIME_IS_VALID (pts)) {</div><div>    GST_LOG_OBJECT (vidsink, "check for clipping on buffer %p with pts %" \</div><div>        GST_TIME_FORMAT " and duration %" GST_TIME_FORMAT,</div>

<div>        buf, GST_TIME_ARGS (pts), GST_TIME_ARGS (duration));</div><div><br></div><div>    clip_start = clip_stop = pts;</div><div>    if (GST_CLOCK_TIME_IS_VALID (duration))</div><div>      clip_stop += duration;</div>

<div><br></div><div>    /* Check if this buffer's timestamp/duration is in our segment */</div><div>    in_seg = gst_segment_clip (&mds_element->segment, GST_FORMAT_TIME,</div><div>        clip_start, clip_stop, &clip_start, &clip_stop);</div>

<div><br></div><div>    if (G_UNLIKELY (!in_seg)) {</div><div>      GST_LOG_OBJECT (vidsink, "dropping buffer due to temporal clipping");</div><div>      gst_buffer_unref (buf);</div><div>      outbuf = NULL;</div>

<div>    }</div><div>  }</div></div><div>}</div><div><br></div><div><br></div><div>Is this a must have function for video sink elements?</div><div><br></div><div>Thanks,</div><div>Yogesh</div></div>