diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-14 12:20:56 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-14 12:20:56 +0100 |
commit | e85ff83fa77c5128fb7dffb4b5c9f82816cad6ab (patch) | |
tree | 1006506de024dc1bb5f3095635f1374b0cea47a1 | |
parent | 27a41f526f75fdf4ff47b2c969a5d252bac30cf3 (diff) | |
download | advtime-e85ff83fa77c5128fb7dffb4b5c9f82816cad6ab.tar.gz advtime-e85ff83fa77c5128fb7dffb4b5c9f82816cad6ab.tar.bz2 advtime-e85ff83fa77c5128fb7dffb4b5c9f82816cad6ab.zip |
video_decode: Use av_close_input if available
Instead of the deprecated av_close_input_file.
Which is still needed becuase OpenBSD's libav is to old.
-rw-r--r-- | src/decode_frame.c | 5 | ||||
-rw-r--r-- | src/video_decode.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/decode_frame.c b/src/decode_frame.c index d518311..b6c1fc1 100644 --- a/src/decode_frame.c +++ b/src/decode_frame.c @@ -174,8 +174,11 @@ main(int argc, char *argv[]) av_free(frame_rgb); av_free(frame); avcodec_close(codec_ctx); +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0) + avformat_close_input(&fmt_ctx); +#else av_close_input_file(fmt_ctx); -// avformat_close_input(&fmt_ctx); +#endif return 0; } diff --git a/src/video_decode.c b/src/video_decode.c index f9e8859..1d17afe 100644 --- a/src/video_decode.c +++ b/src/video_decode.c @@ -82,8 +82,11 @@ video_decode_uninit(struct video_decode **_vd) *_vd = NULL; avcodec_close(vd->codec_ctx); +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0) + avformat_close_input(&vd->fmt_ctx); +#else av_close_input_file(vd->fmt_ctx); -// avformat_close_input(&vd->fmt_ctx); +#endif free(vd); } |