diff --git a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index afd4f79f22..20d092fe1e 100644 --- a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -499,8 +499,7 @@ nal_is_rasl (guint8 nal_type) static gboolean nal_is_slice (guint8 nal_type) { - if ((nal_type >= GST_H265_NAL_SLICE_TRAIL_N) && - (nal_type <= GST_H265_NAL_SLICE_CRA_NUT)) + if ((nal_type <= GST_H265_NAL_SLICE_CRA_NUT)) return TRUE; return FALSE; } diff --git a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index dc005e56bf..8469ac6081 100644 --- a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -3017,11 +3017,11 @@ gst_vaapi_encoder_h264_get_pending_reordered (GstVaapiEncoder * base_encoder, iter->pic_type = GST_VAAPI_PICTURE_TYPE_B; } else if (iter->pic_type == GST_VAAPI_PICTURE_TYPE_B) { pic = g_queue_pop_head (&reorder_pool->reorder_frame_list); - g_assert (pic); } else { GST_WARNING ("Unhandled pending picture type"); } + g_assert (pic); set_frame_num (encoder, pic); if (GST_CLOCK_TIME_IS_VALID (pic->frame->pts)) diff --git a/subprojects/gstreamer-vaapi/tests/check/elements/vaapioverlay.c b/subprojects/gstreamer-vaapi/tests/check/elements/vaapioverlay.c index 8cc87dc454..5b0844757d 100644 --- a/subprojects/gstreamer-vaapi/tests/check/elements/vaapioverlay.c +++ b/subprojects/gstreamer-vaapi/tests/check/elements/vaapioverlay.c @@ -152,11 +152,16 @@ GST_START_TEST (test_overlay_position) fail_unless (handoff_buffer != NULL); pad = gst_element_get_static_pad (sink, "sink"); caps = gst_pad_get_current_caps (pad); - gst_video_info_from_caps (&vinfo, caps); - gst_caps_unref (caps); - gst_object_unref (pad); + if (!gst_video_info_from_caps (&vinfo, caps)) { + GST_ERROR ("Failed to parse the caps"); + goto end; + } + + if (!gst_video_frame_map (&frame, &vinfo, handoff_buffer, GST_MAP_READ)) { + GST_ERROR ("Failed to map the frame"); + goto end; + } - gst_video_frame_map (&frame, &vinfo, handoff_buffer, GST_MAP_READ); { guint i, j, n_planes, plane; n_planes = GST_VIDEO_FRAME_N_PLANES (&frame); @@ -193,7 +198,10 @@ GST_START_TEST (test_overlay_position) } gst_video_frame_unmap (&frame); +end: /* cleanup */ + gst_caps_unref (caps); + gst_object_unref (pad); gst_buffer_replace (&handoff_buffer, NULL); gst_element_set_state (bin, GST_STATE_NULL); g_main_loop_unref (main_loop); diff --git a/subprojects/gstreamer-vaapi/tests/internal/simple-encoder.c b/subprojects/gstreamer-vaapi/tests/internal/simple-encoder.c index 6953eef1a6..b51b92e53a 100644 --- a/subprojects/gstreamer-vaapi/tests/internal/simple-encoder.c +++ b/subprojects/gstreamer-vaapi/tests/internal/simple-encoder.c @@ -298,7 +298,11 @@ app_free (App * app) y4m_reader_close (app->parser); if (app->encoder) { - gst_vaapi_encoder_flush (app->encoder); + if ((gst_vaapi_encoder_flush (app->encoder)) != + GST_VAAPI_ENCODER_STATUS_SUCCESS) + GST_WARNING_OBJECT (app->encoder, + "Failed to flush pending encoded frames"); + gst_object_unref (app->encoder); }