x264: Fix dts comparision

We were assigning to a guint64 value (frame->dts) the sum of a unsigned
and signed value... resulting it the result never being < 0.

Instead just check if it is smaller before assigning to frame->dts.
This commit is contained in:
Edward Hervey 2013-07-26 16:39:12 +02:00
parent c2eb7118be
commit 767005d8c0

View file

@ -1900,12 +1900,13 @@ gst_x264_enc_encode_frame (GstX264Enc * encoder, x264_picture_t * pic_in,
}
}
frame->dts = pic_out.i_dts + encoder->dts_offset;
/* should be ok now, surprise if not */
if (frame->dts < 0) {
if (pic_out.i_dts + encoder->dts_offset < 0) {
/* should be ok now, surprise if not */
GST_WARNING_OBJECT (encoder, "negative dts after offset compensation");
frame->dts = GST_CLOCK_TIME_NONE;
}
} else
frame->dts = pic_out.i_dts + encoder->dts_offset;
if (pic_out.b_keyframe) {
GST_DEBUG_OBJECT (encoder, "Output keyframe");