shithub: treason

Download patch

ref: 5fb764c5f10056357632a54bbeb15c646042a44f
parent: dbd994ee852e77583186f0ebc18f0bcf3aae090f
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Feb 11 07:53:07 EST 2021

h264: initialize more things like wels code does

--- a/decoder_h264.c
+++ b/decoder_h264.c
@@ -285,20 +285,23 @@
 	a->ctx.pVlcTable = &a->vlctbl;
 	a->ctx.pDecoderStatistics = &a->stat;
 	a->ctx.pMemAlign = &cMemoryAlign;
+	a->ctx.pPictInfoList = a->pics;
 	a->ctx.pPictReoderingStatus = a;
 	a->logctx.pfLog = logfun;
 	a->ctx.sLogCtx = a->logctx;
 
+	WelsDecoderDefaults(&a->ctx, &a->logctx);
+	WelsDecoderSpsPpsDefaults(&a->ctx.sSpsPpsCtx);
+
 	a->ctx.pParam = calloc(1, sizeof(SDecodingParam));
 	a->ctx.pParam->sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
 
-	ResetReorderingPictureBuffers(a, a->pics, true);
-
 	if((res = WelsInitDecoder(&a->ctx, &a->logctx)) != 0){
 		werrstr("WelsInitDecoder: %s", err2s(res));
 		free(a);
 		return -1;
 	}
+	ResetReorderingPictureBuffers(a, a->pics, true);
 	d->aux = a;
 	proccreate(decode, d, 65536);