mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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:
parent
c2eb7118be
commit
767005d8c0
1 changed files with 5 additions and 4 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue