diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 9aa3a986e5..f7295dd1f2 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1331,17 +1331,13 @@ gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port, 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); - memcpy (map.data, - buf->omx_buf->pBuffer + buf->omx_buf->nOffset, - buf->omx_buf->nFilledLen); - gst_buffer_unmap (outbuf, &map); - } else { - outbuf = gst_buffer_new (); - } + gst_buffer_map (outbuf, &map, GST_MAP_WRITE); + memcpy (map.data, + buf->omx_buf->pBuffer + buf->omx_buf->nOffset, + buf->omx_buf->nFilledLen); + gst_buffer_unmap (outbuf, &map); GST_BUFFER_TIMESTAMP (outbuf) = gst_util_uint64_scale (GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp),