avcodec/dxva2_h264: fix slice offset in long slice struct after ca2f19b9
authorHendrik Leppkes <h.leppkes@gmail.com>
Sun, 8 May 2016 15:37:30 +0000 (17:37 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Sun, 8 May 2016 15:48:19 +0000 (17:48 +0200)
The GetBitContext now includes the NAL header, which offsets the slice by
one byte, which needs to be accounted for here.

libavcodec/dxva2_h264.c

index 7048c4a..bcba875 100644 (file)
@@ -228,7 +228,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
 
     slice->first_mb_in_slice     = (sl->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + sl->mb_x;
     slice->NumMbsForSlice        = 0; /* XXX it is set once we have all slices */
-    slice->BitOffsetToSliceData  = get_bits_count(&sl->gb);
+    slice->BitOffsetToSliceData  = get_bits_count(&sl->gb) - 8;
     slice->slice_type            = ff_h264_get_slice_type(sl);
     if (sl->slice_type_fixed)
         slice->slice_type += 5;