videodecoder: do not do timestamp arithmetic from an invalid timestamp
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 7 Jun 2012 15:50:17 +0000 (16:50 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 7 Jun 2012 15:59:09 +0000 (16:59 +0100)
This fixes untimestampped buffers from being rejected by the segment clipper.

https://bugzilla.gnome.org/show_bug.cgi?id=676022

gst-libs/gst/video/gstvideodecoder.c

index fb3c8d6..01c24ac 100644 (file)
@@ -1997,7 +1997,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
 
   /* Check for clipping */
   start = frame->pts;
-  stop = frame->pts + frame->duration;
+  stop = start >= 0 ? frame->pts + frame->duration : GST_CLOCK_TIME_NONE;
 
   segment = &decoder->output_segment;
   if (gst_segment_clip (segment, GST_FORMAT_TIME, start, stop, &start, &stop)) {