On 2013-12-09 12:11:43 +0100, Anton Khirnov wrote: > This is a temporary workaround to allow deprecating > avcodec_get_frame_defaults(). The proper solution will be using a > properly allocated AVFrame in Picture. > --- > libavcodec/h264.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/h264.c b/libavcodec/h264.c > index 86d453b..bdf907f 100644 > --- a/libavcodec/h264.c > +++ b/libavcodec/h264.c > @@ -1340,8 +1340,8 @@ int ff_h264_alloc_tables(H264Context *h) > if (!h->DPB) > return AVERROR(ENOMEM); > for (i = 0; i < MAX_PICTURE_COUNT; i++) > - avcodec_get_frame_defaults(&h->DPB[i].f); > - avcodec_get_frame_defaults(&h->cur_pic.f); > + av_frame_unref(&h->DPB[i].f); > + av_frame_unref(&h->cur_pic.f); > } > > return 0; > @@ -1720,7 +1720,7 @@ static int decode_update_thread_context(AVCodecContext > *dst, > h->context_initialized = 0; > > 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->avctx = dst;
ok even if it looks strange to unref previously unused frames just to set some values. Janne _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
