videodecoder: subtract time difference with GST_CLOCK_DIFF

To ensure the subtraction of two GstClockTime values (which are guint64)
can be negative. Use GST_CLOCK_DIFF which returns a gint64.

CID 1338049
This commit is contained in:
Luis de Bethencourt 2015-11-02 12:09:42 +00:00
parent a7123ebb58
commit b81b3f07ec

View file

@ -2699,7 +2699,8 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
GST_DEBUG_OBJECT (decoder,
"sync timestamp %" GST_TIME_FORMAT " diff %" GST_STIME_FORMAT,
GST_TIME_ARGS (frame->pts),
GST_STIME_ARGS (frame->pts - decoder->output_segment.start));
GST_STIME_ARGS (GST_CLOCK_DIFF (frame->pts,
decoder->output_segment.start)));
priv->base_timestamp = frame->pts;
priv->base_picture_number = frame->decode_frame_number;
}