corrected avcodec_alloc_frame error... thought I already had, though

This commit is contained in:
Paul Kohler 2015-12-10 14:11:55 -05:00
parent 0b26955b16
commit b51fba84ef
4 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ import (
static int aacdec_new(aacdec_t *m, uint8_t *buf, int len) {
m->c = avcodec_find_decoder(CODEC_ID_AAC);
m->ctx = avcodec_alloc_context3(m->c);
m->f = avcodec_alloc_frame();
m->f = av_frame_alloc();
m->ctx->extradata = buf;
m->ctx->extradata_size = len;
m->ctx->debug = 0x3;

View File

@ -24,7 +24,7 @@ import (
m->ctx->bit_rate = m->bitrate;
m->ctx->channels = m->channels;
m->ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
m->f = avcodec_alloc_frame();
m->f = av_frame_alloc();
int r = avcodec_open2(m->ctx, m->c, 0);
av_log(m->ctx, AV_LOG_DEBUG, "extra %d\n", m->ctx->extradata_size);
return r;

View File

@ -16,7 +16,7 @@ import (
static int h264dec_new(h264dec_t *h, uint8_t *data, int len) {
h->c = avcodec_find_decoder(CODEC_ID_H264);
h->ctx = avcodec_alloc_context3(h->c);
h->f = avcodec_alloc_frame();
h->f = av_frame_alloc();
h->ctx->extradata = data;
h->ctx->extradata_size = len;
h->ctx->debug = 0x3;

View File

@ -32,7 +32,7 @@ import (
m->ctx->bit_rate = m->bitrate;
m->ctx->pix_fmt = m->pixfmt;
m->ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
m->f = avcodec_alloc_frame();
m->f = av_frame_alloc();
return avcodec_open2(m->ctx, m->c, NULL);
}