[FFmpeg-devel] [PATCH] examples/demuxing: free AVPacket after usage

Stefano Sabatini stefasab at gmail.com
Tue Jan 15 23:40:21 CET 2013


On date Tuesday 2013-01-15 21:16:07 +0100, Angelo Haller encoded:
> This should fix ticket #2142
> 

> From 4c501007567af2e812f0a5e421354bfe5e61b07e Mon Sep 17 00:00:00 2001
> From: Angelo Haller <angelo at szanni.org>
> Date: Mon, 14 Jan 2013 21:26:43 +0100
> Subject: [PATCH] examples/demuxing: free AVPacket after usage
> 
> ---
>  doc/examples/demuxing.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/examples/demuxing.c b/doc/examples/demuxing.c
> index bee21b7..6780e07 100644
> --- a/doc/examples/demuxing.c
> +++ b/doc/examples/demuxing.c
> @@ -292,8 +292,10 @@ int main (int argc, char **argv)
>          printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);
>  
>      /* read frames from the file */
> -    while (av_read_frame(fmt_ctx, &pkt) >= 0)
> +    while (av_read_frame(fmt_ctx, &pkt) >= 0) {
>          decode_packet(&got_frame, 0);
> +        av_free_packet(&pkt);
> +    }

Applied, thanks!
-- 
FFmpeg = Funny & Forgiving Magic Puritan Ecletic Guide


More information about the ffmpeg-devel mailing list