mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
libav 0.7: use avformat_open_input() instead of av_open_input_file()
This commit is contained in:
parent
29fe36522d
commit
dbe22c2c02
@ -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)));
|
||||||
|
@ -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)));
|
||||||
|
@ -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)));
|
||||||
|
Loading…
Reference in New Issue
Block a user