Merge commit '00fd914d4912322212e924c15f325cebf2fde8d3'
authorJames Almer <jamrial@gmail.com>
Fri, 10 Nov 2017 23:31:55 +0000 (20:31 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 10 Nov 2017 23:31:55 +0000 (20:31 -0300)
* commit '00fd914d4912322212e924c15f325cebf2fde8d3':
  hevcdec: set the active SPS before calling get_format()

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/hevcdec.c

index 675025b21190104e31dc89399318468ff62dfb74,664e4ac14b7c5c6b84c4562c587a67d8396ab409..403a8cf454d62b866a26a84946e74e5e02d7e146
@@@ -492,17 -486,14 +492,21 @@@ static int hls_slice_header(HEVCContex
  
      if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) {
          const HEVCSPS *sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data;
 +        const HEVCSPS *last_sps = s->ps.sps;
          enum AVPixelFormat pix_fmt;
  
 +        if (last_sps && IS_IRAP(s) && s->nal_unit_type != HEVC_NAL_CRA_NUT) {
 +            if (sps->width != last_sps->width || sps->height != last_sps->height ||
 +                sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering !=
 +                last_sps->temporal_layer[last_sps->max_sub_layers - 1].max_dec_pic_buffering)
 +                sh->no_output_of_prior_pics_flag = 0;
 +        }
          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;