libav 0.7: use avformat_open_input() instead of av_open_input_file()

This commit is contained in:
Julien BLACHE 2011-09-10 12:04:01 +02:00
parent 29fe36522d
commit dbe22c2c02
3 changed files with 16 additions and 0 deletions

View File

@ -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); 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); ret = av_open_input_file(&src_ctx, filename, NULL, 0, NULL);
#endif
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_WARN, L_ART, "Cannot open artwork file '%s': %s\n", filename, strerror(AVUNERROR(ret))); DPRINTF(E_WARN, L_ART, "Cannot open artwork file '%s': %s\n", filename, strerror(AVUNERROR(ret)));

View File

@ -311,7 +311,13 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
int i; int i;
int ret; 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); ret = av_open_input_file(&ctx, file, NULL, 0, NULL);
#endif
if (ret != 0) if (ret != 0)
{ {
DPRINTF(E_WARN, L_SCAN, "Cannot open media file '%s': %s\n", file, strerror(AVUNERROR(ret))); DPRINTF(E_WARN, L_SCAN, "Cannot open media file '%s': %s\n", file, strerror(AVUNERROR(ret)));

View File

@ -354,7 +354,11 @@ transcode_setup(struct media_file_info *mfi, off_t *est_size, int wavhdr)
} }
memset(ctx, 0, sizeof(struct transcode_ctx)); 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); ret = av_open_input_file(&ctx->fmtctx, mfi->path, NULL, 0, NULL);
#endif
if (ret != 0) if (ret != 0)
{ {
DPRINTF(E_WARN, L_XCODE, "Could not open file %s: %s\n", mfi->fname, strerror(AVUNERROR(ret))); DPRINTF(E_WARN, L_XCODE, "Could not open file %s: %s\n", mfi->fname, strerror(AVUNERROR(ret)));