diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c index 325c7b8cda..1b5a989471 100644 --- a/doc/examples/demuxing_decoding.c +++ b/doc/examples/demuxing_decoding.c @@ -369,10 +369,8 @@ int main (int argc, char **argv) } end: - if (video_dec_ctx) - avcodec_close(video_dec_ctx); - if (audio_dec_ctx) - avcodec_close(audio_dec_ctx); + avcodec_close(video_dec_ctx); + avcodec_close(audio_dec_ctx); avformat_close_input(&fmt_ctx); if (video_dst_file) fclose(video_dst_file); diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c index 35dd4e7d28..8a3d91f41d 100644 --- a/doc/examples/filtering_audio.c +++ b/doc/examples/filtering_audio.c @@ -248,8 +248,7 @@ int main(int argc, char **argv) } end: avfilter_graph_free(&filter_graph); - if (dec_ctx) - avcodec_close(dec_ctx); + avcodec_close(dec_ctx); avformat_close_input(&fmt_ctx); av_frame_free(&frame); av_frame_free(&filt_frame); diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c index 3a26b1aca0..9c9881468d 100644 --- a/doc/examples/filtering_video.c +++ b/doc/examples/filtering_video.c @@ -237,8 +237,7 @@ int main(int argc, char **argv) } end: avfilter_graph_free(&filter_graph); - if (dec_ctx) - avcodec_close(dec_ctx); + avcodec_close(dec_ctx); avformat_close_input(&fmt_ctx); av_frame_free(&frame); av_frame_free(&filt_frame);