From dbe22c2c0298585ee3f5fcbbccacfe9d18eba0f5 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 10 Sep 2011 12:04:01 +0200 Subject: [PATCH] libav 0.7: use avformat_open_input() instead of av_open_input_file() --- src/artwork.c | 6 ++++++ src/filescanner_ffmpeg.c | 6 ++++++ src/transcode.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/src/artwork.c b/src/artwork.c index 8d25580d..c74c9b0f 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -500,7 +500,13 @@ artwork_get(char *filename, int max_w, int max_h, int format, struct evbuffer *e DPRINTF(E_DBG, L_ART, "Artwork request parameters: max w = %d, max h = %d\n", max_w, max_h); + src_ctx = NULL; + +#if LIBAVFORMAT_VERSION_MAJOR >= 53 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 3) + ret = avformat_open_input(&src_ctx, filename, NULL, NULL); +#else ret = av_open_input_file(&src_ctx, filename, NULL, 0, NULL); +#endif if (ret < 0) { DPRINTF(E_WARN, L_ART, "Cannot open artwork file '%s': %s\n", filename, strerror(AVUNERROR(ret))); diff --git a/src/filescanner_ffmpeg.c b/src/filescanner_ffmpeg.c index d364c426..5a50b611 100644 --- a/src/filescanner_ffmpeg.c +++ b/src/filescanner_ffmpeg.c @@ -311,7 +311,13 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi) int i; int ret; + ctx = NULL; + +#if LIBAVFORMAT_VERSION_MAJOR >= 53 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 3) + ret = avformat_open_input(&ctx, file, NULL, NULL); +#else ret = av_open_input_file(&ctx, file, NULL, 0, NULL); +#endif if (ret != 0) { DPRINTF(E_WARN, L_SCAN, "Cannot open media file '%s': %s\n", file, strerror(AVUNERROR(ret))); diff --git a/src/transcode.c b/src/transcode.c index 80500a4a..2d704ed5 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -354,7 +354,11 @@ transcode_setup(struct media_file_info *mfi, off_t *est_size, int wavhdr) } memset(ctx, 0, sizeof(struct transcode_ctx)); +#if LIBAVFORMAT_VERSION_MAJOR >= 53 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 3) + ret = avformat_open_input(&ctx->fmtctx, mfi->path, NULL, NULL); +#else ret = av_open_input_file(&ctx->fmtctx, mfi->path, NULL, 0, NULL); +#endif if (ret != 0) { DPRINTF(E_WARN, L_XCODE, "Could not open file %s: %s\n", mfi->fname, strerror(AVUNERROR(ret)));