From 2eb439416de641c56d09efa4a33671ab983eac12 Mon Sep 17 00:00:00 2001 From: Scott D Phillips Date: Fri, 26 Aug 2016 14:55:17 -0700 Subject: [PATCH] decoder: vc1: Fail only on actual interlaced frames In the earlier patch: f31d9f3 decoder: vc1: Print error on interlaced content Decoding would error out if the interlace flag was set in the sequence bdu. This isn't quite right because a video can have this flag set and yet not have any interlaced pictures. Here instead we error out when either parsing a field bdu or decoding a frame bdu which has fcm set to anything other than progressive. Signed-off-by: Scott D Phillips https://bugzilla.gnome.org/show_bug.cgi?id=769250 --- gst-libs/gst/vaapi/gstvaapidecoder_vc1.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c index 00ee16ae37..7cfd4d284d 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c @@ -276,11 +276,6 @@ decode_sequence (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, priv->has_entrypoint = FALSE; - if (adv_hdr->interlace != 0) { - GST_ERROR ("interlaced sequence unsupported"); - return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; - } - /* Reset POC */ if (priv->last_non_b_picture) { if (priv->last_non_b_picture->poc == priv->next_poc) @@ -962,6 +957,11 @@ decode_frame (GstVaapiDecoderVC1 * decoder, GstVC1BDU * rbdu, GstVC1BDU * ebdu) return get_status (result); } + if (frame_hdr->pic.advanced.fcm != GST_VC1_FRAME_PROGRESSIVE) { + GST_ERROR ("interlaced video not supported"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + switch (frame_hdr->ptype) { case GST_VC1_PICTURE_TYPE_I: picture->type = GST_VAAPI_PICTURE_TYPE_I; @@ -1303,6 +1303,9 @@ gst_vaapi_decoder_vc1_parse (GstVaapiDecoder * base_decoder, case GST_VC1_SLICE: flags |= GST_VAAPI_DECODER_UNIT_FLAG_SLICE; break; + case GST_VC1_FIELD: + GST_ERROR ("interlaced video not supported"); + return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE; } GST_VAAPI_DECODER_UNIT_FLAG_SET (unit, flags); return GST_VAAPI_DECODER_STATUS_SUCCESS;