h264: avoid unnecessary calls to get_format
authorRainer Hochecker <fernetmenta@online.de>
Tue, 31 Mar 2015 06:27:01 +0000 (08:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 31 Mar 2015 10:14:39 +0000 (12:14 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264_slice.c

index dfb44ac..c10568a 100644 (file)
@@ -1325,7 +1325,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
                      || h->mb_width  != h->sps.mb_width
                      || h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
                     ));
-    if (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0)))
+    if (h->avctx->pix_fmt == AV_PIX_FMT_NONE
+        || (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0))))
         must_reinit = 1;
 
     if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))