summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_lavcac3enc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-07-24 19:06:00 +0200
committerwm4 <wm4@nowhere>2016-07-24 19:06:00 +0200
commit3623cec7d2753ec7e7bf1ca73580203acb3347c8 (patch)
tree2563ead45b6b86ae6889f76b3e9095da68703301 /audio/filter/af_lavcac3enc.c
parentd60db967bda3e9910ec6bc78d0d0cb284f5d68fa (diff)
downloadmpv-3623cec7d2753ec7e7bf1ca73580203acb3347c8.tar.bz2
mpv-3623cec7d2753ec7e7bf1ca73580203acb3347c8.tar.xz
af_lavcac3enc: use common code for AVFrame setup
Diffstat (limited to 'audio/filter/af_lavcac3enc.c')
-rw-r--r--audio/filter/af_lavcac3enc.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c
index 26c9cbff58..31b84e1528 100644
--- a/audio/filter/af_lavcac3enc.c
+++ b/audio/filter/af_lavcac3enc.c
@@ -249,17 +249,8 @@ static int read_input_frame(struct af_instance *af, AVFrame *frame)
if (!fill_buffer(af))
return 0; // need more input
- frame->nb_samples = s->in_samples;
- frame->format = s->lavc_actx->sample_fmt;
- frame->channel_layout = s->lavc_actx->channel_layout;
-#if LIBAVUTIL_VERSION_MICRO >= 100
- frame->channels = s->lavc_actx->channels;
-#endif
- assert(s->input->num_planes <= AV_NUM_DATA_POINTERS);
- frame->extended_data = frame->data;
- for (int n = 0; n < s->input->num_planes; n++)
- frame->data[n] = s->input->planes[n];
- frame->linesize[0] = s->input->samples * s->input->sstride;
+ if (mp_audio_to_avframe(s->input, frame) < 0)
+ return -1;
return 1;
}