[FFmpeg-cvslog] hevcdec: set the active SPS before calling get_format()

Anton Khirnov git at videolan.org
Sat Nov 11 02:08:02 EET 2017


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Jul 24 11:41:31 2017 +0200| [00fd914d4912322212e924c15f325cebf2fde8d3] | committer: Anton Khirnov

hevcdec: set the active SPS before calling get_format()

This way the SPS is available to the hwaccel init code.

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

 libavcodec/hevcdec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index f6bbb7051e..664e4ac14b 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -490,13 +490,14 @@ static int hls_slice_header(HEVCContext *s)
 
         ff_hevc_clear_refs(s);
 
+        ret = set_sps(s, sps, sps->pix_fmt);
+        if (ret < 0)
+            return ret;
+
         pix_fmt = get_format(s, sps);
         if (pix_fmt < 0)
             return pix_fmt;
-
-        ret = set_sps(s, sps, pix_fmt);
-        if (ret < 0)
-            return ret;
+        s->avctx->pix_fmt = pix_fmt;
 
         s->seq_decode = (s->seq_decode + 1) & 0xff;
         s->max_ra     = INT_MAX;



More information about the ffmpeg-cvslog mailing list