examples/filtering_audio: enable ref counted frames

Fixes accessing freed memory

Signe-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-04-17 10:46:16 +02:00
parent 9db6aaeb2c
commit f2619cbd61

View File

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