diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-17 02:25:20 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-03-17 15:45:36 +0100 |
commit | d8fe6957796a95f936d7b16db559a164db7e9de4 (patch) | |
tree | 27ad736d310ad0c7008e78cdfaa10ed15c0e4588 | |
parent | f4489c9558c983dcf0e00e9a706f1e5cc653e9e3 (diff) | |
download | ffmpeg-d8fe6957796a95f936d7b16db559a164db7e9de4.tar.gz |
avcodec/h264: be more tolerant on what pixel format changes trigger reinits
Fixes Ticket3260
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e92ff25469f75f5c1fcbb9ba5721cea341ca34a)
-rw-r--r-- | libavcodec/h264.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9379b2ff4a..ec3601f994 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3444,6 +3444,17 @@ int ff_set_ref_count(H264Context *h) return 0; } +static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a) +{ + switch (a) { + case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P; + case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P; + case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P; + default: + return a; + } +} + /** * Decode a slice header. * This will (re)intialize the decoder and call h264_frame_start() as needed. @@ -3573,7 +3584,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0) || h->mb_width != h->sps.mb_width || h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) )); - if (h0->avctx->pix_fmt != get_pixel_format(h0, 0)) + if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0))) must_reinit = 1; h->mb_width = h->sps.mb_width; |