[FFmpeg-devel] [PATCH] showwaves: fix first sample of frame test.
Stefano Sabatini
stefasab at gmail.com
Sat Jun 23 14:18:37 CEST 2012
On date Saturday 2012-06-23 11:52:46 +0200, Nicolas George encoded:
> Avoids a huge memleak when n != 1.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
> libavfilter/avf_showwaves.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> Note: I used "== 0" to be consistent with the existing code.
>
>
> diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
> index 645065f..90d3ec9 100644
> --- a/libavfilter/avf_showwaves.c
> +++ b/libavfilter/avf_showwaves.c
> @@ -196,7 +196,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
>
> /* draw data in the buffer */
> for (i = 0; i < nb_samples; i++) {
> - if (showwaves->buf_idx == 0) {
> + if (showwaves->buf_idx == 0 && showwaves->sample_count_mod == 0) {
> showwaves->outpicref = outpicref =
> ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN,
> outlink->w, outlink->h);
10l, should be ok if tested, thanks.
--
FFmpeg = Fanciful Fantastic Mastering Peaceless Ermetic Guide
More information about the ffmpeg-devel
mailing list