mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
h264: call av_frame_unref() instead of avcodec_get_frame_defaults().
This is a temporary workaround to allow deprecating avcodec_get_frame_defaults(). The proper solution will be using a properly allocated AVFrame in Picture.
This commit is contained in:
parent
48d17ee6dc
commit
598ce4ab4f
@ -1341,8 +1341,8 @@ int ff_h264_alloc_tables(H264Context *h)
|
|||||||
if (!h->DPB)
|
if (!h->DPB)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
for (i = 0; i < MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < MAX_PICTURE_COUNT; i++)
|
||||||
avcodec_get_frame_defaults(&h->DPB[i].f);
|
av_frame_unref(&h->DPB[i].f);
|
||||||
avcodec_get_frame_defaults(&h->cur_pic.f);
|
av_frame_unref(&h->cur_pic.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1721,7 +1721,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
|||||||
h->context_initialized = 0;
|
h->context_initialized = 0;
|
||||||
|
|
||||||
memset(&h->cur_pic, 0, sizeof(h->cur_pic));
|
memset(&h->cur_pic, 0, sizeof(h->cur_pic));
|
||||||
avcodec_get_frame_defaults(&h->cur_pic.f);
|
av_frame_unref(&h->cur_pic.f);
|
||||||
h->cur_pic.tf.f = &h->cur_pic.f;
|
h->cur_pic.tf.f = &h->cur_pic.f;
|
||||||
|
|
||||||
h->avctx = dst;
|
h->avctx = dst;
|
||||||
|
Loading…
Reference in New Issue
Block a user