examples/filtering_audio: enable ref counted frames
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Apr 2013 08:46:16 +0000 (10:46 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Apr 2013 09:11:57 +0000 (11:11 +0200)
Fixes accessing freed memory

Signe-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/filtering_audio.c

index 67588aa..d629d79 100644 (file)
@@ -70,6 +70,7 @@ static int open_input_file(const char *filename)
     }
     audio_stream_index = ret;
     dec_ctx = fmt_ctx->streams[audio_stream_index]->codec;
+    av_opt_set_int(dec_ctx, "refcounted_frames", 1, 0);
 
     /* init the audio decoder */
     if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) {