1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

hevc: do not pass an entire HEVCContext into export_stream_params()

It only needs the parameter sets.
This commit is contained in:
Anton Khirnov 2015-07-12 18:52:02 +02:00
parent 650060dfb6
commit 18156b53f9

View File

@ -383,10 +383,10 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
return 0;
}
static void export_stream_params(AVCodecContext *avctx,
const HEVCContext *s, const HEVCSPS *sps)
static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
const HEVCSPS *sps)
{
const HEVCVPS *vps = (const HEVCVPS*)s->ps.vps_list[sps->vps_id]->data;
const HEVCVPS *vps = (const HEVCVPS*)ps->vps_list[sps->vps_id]->data;
unsigned int num = 0, den = 0;
avctx->pix_fmt = sps->pix_fmt;
@ -435,7 +435,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
int ret;
export_stream_params(s->avctx, s, sps);
export_stream_params(s->avctx, &s->ps, sps);
pic_arrays_free(s);
ret = pic_arrays_init(s, sps);
@ -3017,7 +3017,7 @@ static int hevc_decode_extradata(HEVCContext *s)
for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++) {
if (s->ps.sps_list[i]) {
const HEVCSPS *sps = (const HEVCSPS*)s->ps.sps_list[i]->data;
export_stream_params(s->avctx, s, sps);
export_stream_params(s->avctx, &s->ps, sps);
break;
}
}