summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Thai <thong.thai@amd.com>2022-11-09 14:24:56 -0500
committerLeo Liu <leo.liu@amd.com>2022-11-09 14:30:07 -0500
commitee23236088a603187084688368a5931012d57483 (patch)
tree6c9e6fa377c05c48fe3b6a9a9e0a11bb97106b9c
parent8b37f6589ed655af5e6d66d8764ffd57c2db2efb (diff)
gstomxvideoenc: handle no best frame foundHEADmaster
Signed-off-by: Thong Thai <thong.thai@amd.com>
-rw-r--r--omx/gstomxvideoenc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 2f5a7ca..d01acf9 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1056,6 +1056,12 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
GST_VIDEO_ENCODER_STREAM_LOCK (self);
frame = gst_omx_video_enc_find_nearest_frame (self, buf);
+ if (!frame) {
+ GST_WARNING_OBJECT (self, "No best frame has been found");
+ gst_omx_port_release_buffer (self->enc_out_port, buf);
+ goto flow_error;
+ }
+
GST_INFO_OBJECT (self, "dts %" GST_TIME_FORMAT " pts %" GST_TIME_FORMAT,
GST_TIME_ARGS(frame->dts), GST_TIME_ARGS(frame->pts));