avcodec: remove unnecessary calls to ff_init_buffer_info()

And remove the function altogether while at it. It's a duplicate of
another.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2018-02-13 18:42:04 -03:00
parent 3b4026e151
commit 23e1bf6e51
4 changed files with 2 additions and 18 deletions

View File

@ -130,7 +130,7 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt)
if (pkt) {
ret = av_packet_copy_props(avci->last_pkt_props, pkt);
if (!ret)
avci->last_pkt_props->size = pkt->size; // HACK: Needed for ff_init_buffer_info().
avci->last_pkt_props->size = pkt->size; // HACK: Needed for ff_decode_frame_props().
}
return ret;
}
@ -1661,7 +1661,7 @@ static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame)
return av_packet_unpack_dictionary(side_metadata, size, frame_md);
}
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
const AVPacket *pkt = avctx->internal->last_pkt_props;
int i;
@ -1769,11 +1769,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
}
static void validate_avframe_allocation(AVCodecContext *avctx, AVFrame *frame)
{
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
@ -1916,8 +1911,6 @@ static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
av_frame_unref(frame);
}
ff_init_buffer_info(avctx, frame);
if (!frame->data[0])
return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);

View File

@ -235,12 +235,6 @@ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
unsigned int avpriv_toupper4(unsigned int x);
/**
* does needed setup of pkt_pts/pos and such for (re)get_buffer();
*/
int ff_init_buffer_info(AVCodecContext *s, AVFrame *frame);
void ff_color_frame(AVFrame *frame, const int color[4]);
/**

View File

@ -886,8 +886,6 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int
f->owner[0] = f->owner[1] = avctx;
ff_init_buffer_info(avctx, f->f);
if (!(avctx->active_thread_type & FF_THREAD_FRAME))
return ff_get_buffer(avctx, f->f, flags);

View File

@ -193,7 +193,6 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
s->picture[1]->width = avctx->width;
s->picture[1]->height = avctx->height;
s->picture[1]->format = avctx->pix_fmt;
/* ff_init_buffer_info(avctx, &s->picture[1]); */
smv_img_pnt(s->picture[1]->data, mjpeg_data->data, mjpeg_data->linesize,
avctx->pix_fmt, avctx->width, avctx->height, cur_frame);
for (i = 0; i < AV_NUM_DATA_POINTERS; i++)