From 49b1dca2d37f42e105ab735be5615cdaa8c35243 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 2 Apr 2012 18:42:12 +0200 Subject: [PATCH] mpeg2: fix calculation of macroblock_offset. Fix decoding of streams with extra slice() information before the first macroblock(). e.g. this fixes sony-ct3.bs from conformance test. --- NEWS | 3 ++- gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 17867ef96a..05c54caf33 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,8 @@ Copyright (C) 2011 Collabora Version 0.3.7 - DD.Apr.2012 * Fix vaapidecode to report unsupported codec profiles -* Fix decoding of MPEG-2 High profile streams compatible with Main profile +* Fix MPEG-2 decoding of streams with extra slice() information +* Fix MPEG-2 decoding of High profile streams compatible with Main profile * Don't forcibly resize user provided X windows (Holger Kaelberer) * Recalculate render rect only if caps are negotiated (Holger Kaelberer) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c index 3333c2e2ca..38ecb33277 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c @@ -870,7 +870,7 @@ decode_slice( guint macroblock_offset; guint8 slice_vertical_position_extension; guint8 quantiser_scale_code; - guint8 intra_slice_flag, intra_slice = 0; + guint8 intra_slice = 0; guint8 extra_bit_slice, junk8; GST_DEBUG("slice %d @ %p, %u bytes)", slice_no, buf, buf_size); @@ -896,11 +896,8 @@ decode_slice( READ_UINT8(&br, quantiser_scale_code, 5); READ_UINT8(&br, extra_bit_slice, 1); if (extra_bit_slice == 1) { - READ_UINT8(&br, intra_slice_flag, 1); - if (intra_slice_flag) { - READ_UINT8(&br, intra_slice, 1); - READ_UINT8(&br, junk8, 7); - } + READ_UINT8(&br, intra_slice, 1); + READ_UINT8(&br, junk8, 7); READ_UINT8(&br, extra_bit_slice, 1); while (extra_bit_slice == 1) { READ_UINT8(&br, junk8, 8);