videoencoder: Check for invalid stop position before calculating a duration from it
https://bugzilla.gnome.org/show_bug.cgi?id=707332
This commit is contained in:
parent
57d0a5d794
commit
d03feedf4c
@ -1290,10 +1290,15 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (cstop))
|
||||||
|
duration = cstop - cstart;
|
||||||
|
else
|
||||||
|
duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
/* incoming DTS is not really relevant and does not make sense anyway,
|
/* incoming DTS is not really relevant and does not make sense anyway,
|
||||||
* so pass along _NONE and maybe come up with something better later on */
|
* so pass along _NONE and maybe come up with something better later on */
|
||||||
frame = gst_video_encoder_new_frame (encoder, buf, cstart,
|
frame = gst_video_encoder_new_frame (encoder, buf, cstart,
|
||||||
GST_CLOCK_TIME_NONE, cstop - cstart);
|
GST_CLOCK_TIME_NONE, duration);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (encoder);
|
GST_OBJECT_LOCK (encoder);
|
||||||
if (priv->force_key_unit) {
|
if (priv->force_key_unit) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user