[FFmpeg-cvslog] h264: avoid unnecessary calls to get_format

Rainer Hochecker git at videolan.org
Sat Apr 25 17:04:46 CEST 2015


ffmpeg | branch: release/2.4 | Rainer Hochecker <fernetmenta at online.de> | Tue Mar 31 08:27:01 2015 +0200| [07a7f384217df47442178280ac7172c4fcbf0ccb] | committer: Michael Niedermayer

h264: avoid unnecessary calls to get_format

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2197b4018920e5cd7ac465de007b675565687b23)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07a7f384217df47442178280ac7172c4fcbf0ccb
---

 libavcodec/h264_slice.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 38273e3..3a7ea4d 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1438,7 +1438,8 @@ int ff_h264_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 (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
+    if (h0->avctx->pix_fmt == AV_PIX_FMT_NONE
+        || (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0))))
         must_reinit = 1;
 
     if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))



More information about the ffmpeg-cvslog mailing list