On 7/30/2019 2:59 AM, Limin Wang wrote: >> + if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { >> + EB_BUFFERHEADERTYPE *header_ptr = NULL; >> + >> + svt_ret = EbH265EncStreamHeader(svt_enc->svt_handle, &header_ptr); >> + if (svt_ret != EB_ErrorNone) { >> + av_log(avctx, AV_LOG_ERROR, "Failed to build stream header\n"); >> + goto failed_init_encoder; >> + } >> + >> + avctx->extradata_size = header_ptr->nFilledLen; >> + avctx->extradata = av_malloc(avctx->extradata_size + >> AV_INPUT_BUFFER_PADDING_SIZE); > It's preferalbe to use av_mallocz
He was asked to do it this way as it's faster. No need to zero the whole buffer if it's going to be written to immediately afterwards. Only the trailing padding bytes needs to be zeroed. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".