summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-16 13:03:54 +0100
committerwm4 <wm4@nowhere>2014-03-16 13:19:29 +0100
commit113ec0aba1997d35d221892d2afb12599680da1d (patch)
tree7701dd928c7d3ecd05289062355c1637f7cabebc /audio
parent05e3a5a2b4f4d675b31a06958ae8d2c95b992857 (diff)
downloadmpv-113ec0aba1997d35d221892d2afb12599680da1d.tar.bz2
mpv-113ec0aba1997d35d221892d2afb12599680da1d.tar.xz
af_lavcac3enc: use new AVFrame API
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af_lavcac3enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c
index 34de6adb74..02211a2a61 100644
--- a/audio/filter/af_lavcac3enc.c
+++ b/audio/filter/af_lavcac3enc.c
@@ -185,7 +185,7 @@ static int filter(struct af_instance* af, struct mp_audio* audio, int flags)
}
in_frame.samples = s->in_samples;
- AVFrame *frame = avcodec_alloc_frame();
+ AVFrame *frame = av_frame_alloc();
if (!frame) {
MP_FATAL(af, "Could not allocate memory \n");
return -1;
@@ -194,19 +194,19 @@ static int filter(struct af_instance* af, struct mp_audio* audio, int flags)
frame->format = s->lavc_actx->sample_fmt;
frame->channel_layout = s->lavc_actx->channel_layout;
assert(in_frame.num_planes <= AV_NUM_DATA_POINTERS);
+ frame->extended_data = frame->data;
for (int n = 0; n < in_frame.num_planes; n++)
frame->data[n] = in_frame.planes[n];
frame->linesize[0] = s->in_samples * audio->sstride;
int ok;
ret = avcodec_encode_audio2(s->lavc_actx, &s->pkt, frame, &ok);
+ av_frame_free(&frame);
if (ret < 0 || !ok) {
MP_FATAL(af, "Encode failed.\n");
return -1;
}
- avcodec_free_frame(&frame);
-
mp_audio_buffer_skip(s->pending, consumed_pending);
MP_DBG(af, "avcodec_encode_audio got %d, pending %d.\n",