diff options
author | Edward Hervey <edward@collabora.com> | 2013-07-26 16:39:12 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2013-07-26 16:47:30 +0200 |
commit | 767005d8c05a9c5afad95ff868ed8b3952e4b38b (patch) | |
tree | 4e0cffaa60c094581ab37ddfdce6f7a983d0b8fb | |
parent | c2eb7118beb6d2eb456f275ef7b597855c721e1b (diff) |
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.
-rw-r--r-- | ext/x264/gstx264enc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index e4631d41..037de665 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -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"); |