On Fri, May 5, 2017 at 1:01 PM, Muhammad Faiz <mfc...@gmail.com> wrote: > This should fix Ticket6349. > Since 383057f8e744efeaaa3648a59bc577b25b055835, framequeue may > generate unaligned frame data. > > Signed-off-by: Muhammad Faiz <mfc...@gmail.com> > --- > libavfilter/avfilter.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c > index 08b86b0..504f5c6 100644 > --- a/libavfilter/avfilter.c > +++ b/libavfilter/avfilter.c > @@ -1192,7 +1192,31 @@ static int take_samples(AVFilterLink *link, unsigned > min, unsigned max, > av_assert1(samples_ready(link, link->min_samples)); > frame0 = frame = ff_framequeue_peek(&link->fifo, 0); > if (frame->nb_samples >= min && frame->nb_samples < max) { > - *rframe = ff_framequeue_take(&link->fifo); > + int align = 32; > + if (!((align - 1) & (intptr_t)frame->data[0])) { > + *rframe = ff_framequeue_take(&link->fifo); > + return 0; > + } > + > + buf = ff_get_audio_buffer(link, frame->nb_samples); > + if (!buf) > + return AVERROR(ENOMEM); > + > + ret = av_frame_copy_props(buf, frame); > + if (ret < 0) { > + av_frame_free(&buf); > + return ret; > + } > + > + ret = av_frame_copy(buf, frame); > + if (ret < 0) { > + av_frame_free(&buf); > + return ret; > + } > + > + frame = ff_framequeue_take(&link->fifo); > + av_frame_free(&frame); > + *rframe = buf; > return 0; > } > nb_frames = 0; > -- > 2.9.3 >
Is it ok to push this? Thank's. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel