mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
mpeg2: don't decode anything before the first sequence_header().
Skip all pictures prior to the first sequence_header(). Besides, skip all picture_data() if there was no prior picture_header(). Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
2ebfa66ade
commit
fc3edde05c
1 changed files with 6 additions and 0 deletions
|
@ -798,6 +798,8 @@ decode_buffer(GstVaapiDecoderMpeg2 *decoder, GstBuffer *buffer)
|
|||
type = start_code & 0xff;
|
||||
switch (type) {
|
||||
case GST_MPEG_VIDEO_PACKET_PICTURE:
|
||||
if (!priv->width || !priv->height)
|
||||
break;
|
||||
status = decode_picture(decoder, buf, buf_size);
|
||||
break;
|
||||
case GST_MPEG_VIDEO_PACKET_SEQUENCE:
|
||||
|
@ -813,6 +815,8 @@ decode_buffer(GstVaapiDecoderMpeg2 *decoder, GstBuffer *buffer)
|
|||
status = decode_quant_matrix_ext(decoder, buf, buf_size);
|
||||
break;
|
||||
case GST_MPEG_VIDEO_PACKET_EXT_PICTURE:
|
||||
if (!priv->width || !priv->height)
|
||||
break;
|
||||
status = decode_picture_ext(decoder, buf, buf_size);
|
||||
break;
|
||||
default:
|
||||
|
@ -835,6 +839,8 @@ decode_buffer(GstVaapiDecoderMpeg2 *decoder, GstBuffer *buffer)
|
|||
default:
|
||||
if (type >= GST_MPEG_VIDEO_PACKET_SLICE_MIN &&
|
||||
type <= GST_MPEG_VIDEO_PACKET_SLICE_MAX) {
|
||||
if (!priv->current_picture)
|
||||
break;
|
||||
status = decode_slice(
|
||||
decoder,
|
||||
type - GST_MPEG_VIDEO_PACKET_SLICE_MIN,
|
||||
|
|
Loading…
Reference in a new issue