omxvideoenc: Remove unneeded size check

We only enter this branch if nFilledLen > 0, there is not need
to check again.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
This commit is contained in:
Nicolas Dufresne 2018-09-07 23:09:29 -04:00
parent 35abdd16d1
commit d80504afcc

View file

@ -1331,17 +1331,13 @@ gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
GST_DEBUG_OBJECT (self, "Handling output data"); GST_DEBUG_OBJECT (self, "Handling output data");
if (buf->omx_buf->nFilledLen > 0) { outbuf = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen);
outbuf = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen);
gst_buffer_map (outbuf, &map, GST_MAP_WRITE); gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
memcpy (map.data, memcpy (map.data,
buf->omx_buf->pBuffer + buf->omx_buf->nOffset, buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen); buf->omx_buf->nFilledLen);
gst_buffer_unmap (outbuf, &map); gst_buffer_unmap (outbuf, &map);
} else {
outbuf = gst_buffer_new ();
}
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (outbuf) =
gst_util_uint64_scale (GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp), gst_util_uint64_scale (GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp),