Browse Source

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>
tags/n4.0
James Almer 7 years ago
parent
commit
23e1bf6e51
4 changed files with 2 additions and 18 deletions
  1. +2
    -9
      libavcodec/decode.c
  2. +0
    -6
      libavcodec/internal.h
  3. +0
    -2
      libavcodec/pthread_frame.c
  4. +0
    -1
      libavcodec/smvjpegdec.c

+ 2
- 9
libavcodec/decode.c 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);



+ 0
- 6
libavcodec/internal.h 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]);

/**


+ 0
- 2
libavcodec/pthread_frame.c 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);



+ 0
- 1
libavcodec/smvjpegdec.c 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++)


Loading…
Cancel
Save