mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
mpeg2: catch incorrect picture_structure from bitstreams.
Assume "frame" picture structure if the syntax element was zero or if progressive_frame is set.
This commit is contained in:
parent
8bbe22f831
commit
10dfc67cca
1 changed files with 8 additions and 0 deletions
|
@ -582,6 +582,14 @@ decode_picture_ext(GstVaapiDecoderMpeg2 *decoder, guchar *buf, guint buf_size)
|
|||
}
|
||||
priv->has_pic_ext = TRUE;
|
||||
|
||||
if (pic_ext->picture_structure == 0 ||
|
||||
(pic_ext->progressive_frame &&
|
||||
pic_ext->picture_structure != GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME)) {
|
||||
GST_WARNING("invalid picture_structure %d, replacing with \"frame\"",
|
||||
pic_ext->picture_structure);
|
||||
pic_ext->picture_structure = GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME;
|
||||
}
|
||||
|
||||
switch (pic_ext->picture_structure) {
|
||||
case GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD:
|
||||
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_TOP_FIELD);
|
||||
|
|
Loading…
Reference in a new issue