Skip to content

Commit

Permalink
libavcodec: mpeg12dec: fix broken decode with vaapi
Browse files Browse the repository at this point in the history
There are (wrongly?) encoded input where the coded order of fields is
different from the one specified in extension header.
Without those flags, decoded output gets broken when vaapi is used.
See also in mpeg_mc_decode_init() for XvMC.
  • Loading branch information
0p1pp1 authored and 0p1pp1 committed Aug 2, 2018
1 parent c71fc15 commit 311716d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/mpeg12dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)

avctx->pix_fmt = mpeg_get_pixelformat(avctx);
setup_hwaccel_for_pixfmt(avctx);
if (avctx->hwaccel)
avctx->slice_flags |= SLICE_FLAG_CODED_ORDER | SLICE_FLAG_ALLOW_FIELD;

/* Quantization matrices may need reordering
* if DCT permutation is changed. */
Expand Down

0 comments on commit 311716d

Please sign in to comment.