codecs: mpeg2decoder: decode only if B and not closed gop

Mark as decode only if picture type is B, without previous picture in DBP and
closed_gop is 0 as might be understood in "6.3.8 Group of pictures header".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-01-06 16:38:14 +01:00
parent ec15caff93
commit a926511df4

View file

@ -732,6 +732,11 @@ gst_mpeg2_decoder_start_current_picture (GstMpeg2Decoder * decoder,
gst_mpeg2_dpb_get_neighbours (priv->dpb, priv->current_picture,
&prev_picture, &next_picture);
if (priv->current_picture->type == GST_MPEG_VIDEO_PICTURE_TYPE_B
&& !prev_picture && !priv->gop.closed_gop) {
GST_VIDEO_CODEC_FRAME_FLAG_SET (priv->current_frame,
GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY);
}
ret = klass->start_picture (decoder, priv->current_picture, slice,
prev_picture, next_picture);