Revert "avcodec/hevc_ps: allocate only the required HEVCHdrParams within a VPS"
This reverts commit 456c8ebe7c
.
Currently broken and causing playback glitches
This commit is contained in:
parent
b58e7afc93
commit
6914129057
|
@ -442,20 +442,13 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uninit_vps(FFRefStructOpaque opaque, void *obj)
|
|
||||||
{
|
|
||||||
HEVCVPS *vps = obj;
|
|
||||||
|
|
||||||
av_freep(&vps->hdr);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
|
int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
|
||||||
HEVCParamSets *ps)
|
HEVCParamSets *ps)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
int vps_id = 0;
|
int vps_id = 0;
|
||||||
ptrdiff_t nal_size;
|
ptrdiff_t nal_size;
|
||||||
HEVCVPS *vps = ff_refstruct_alloc_ext(sizeof(*vps), 0, NULL, uninit_vps);
|
HEVCVPS *vps = ff_refstruct_allocz(sizeof(*vps));
|
||||||
|
|
||||||
if (!vps)
|
if (!vps)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
@ -544,11 +537,6 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
|
||||||
"vps_num_hrd_parameters %d is invalid\n", vps->vps_num_hrd_parameters);
|
"vps_num_hrd_parameters %d is invalid\n", vps->vps_num_hrd_parameters);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
vps->hdr = av_calloc(vps->vps_num_hrd_parameters, sizeof(*vps->hdr));
|
|
||||||
if (!vps->hdr)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
for (i = 0; i < vps->vps_num_hrd_parameters; i++) {
|
for (i = 0; i < vps->vps_num_hrd_parameters; i++) {
|
||||||
int common_inf_present = 1;
|
int common_inf_present = 1;
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ typedef struct PTL {
|
||||||
|
|
||||||
typedef struct HEVCVPS {
|
typedef struct HEVCVPS {
|
||||||
unsigned int vps_id;
|
unsigned int vps_id;
|
||||||
HEVCHdrParams *hdr;
|
HEVCHdrParams hdr[HEVC_MAX_LAYER_SETS];
|
||||||
|
|
||||||
uint8_t vps_temporal_id_nesting_flag;
|
uint8_t vps_temporal_id_nesting_flag;
|
||||||
int vps_max_layers;
|
int vps_max_layers;
|
||||||
|
|
Loading…
Reference in New Issue