mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
decoder: h264: fix DPB clear when no decoding actually started.
Fix dpb_clear() to clear previous frame buffers only if they actually exist to begin with. If the decoder bailed out early, e.g. when it does not support a specific profile, that array of previous frames might not be allocated beforehand.
This commit is contained in:
parent
cb9f98f0d5
commit
8db72147c7
1 changed files with 3 additions and 2 deletions
|
@ -855,8 +855,9 @@ dpb_clear(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture)
|
|||
|
||||
/* Clear previous frame buffers only if this is a "flush-all" operation,
|
||||
or if the picture is the first one in the access unit */
|
||||
if (!picture || GST_VAAPI_PICTURE_FLAG_IS_SET(picture,
|
||||
GST_VAAPI_PICTURE_FLAG_AU_START)) {
|
||||
if (priv->prev_frames && (!picture ||
|
||||
GST_VAAPI_PICTURE_FLAG_IS_SET(picture,
|
||||
GST_VAAPI_PICTURE_FLAG_AU_START))) {
|
||||
for (i = 0; i < priv->max_views; i++)
|
||||
gst_vaapi_picture_replace(&priv->prev_frames[i], NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue