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.
This commit is contained in:
Gwenole Beauchesne 2012-04-02 18:42:12 +02:00
parent 2d36f6199e
commit 49b1dca2d3
2 changed files with 5 additions and 7 deletions

3
NEWS
View file

@ -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)

View file

@ -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);