mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 13:13:17 -05:00
Fix for issue #62 (slow internet streams), credit @chme
This commit is contained in:
parent
d55d194201
commit
2879458e98
@ -163,7 +163,7 @@ dnl Check for av_lock_manager (ffmpeg >= 0.5.1)
|
|||||||
AC_CHECK_LIB([avcodec], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
|
AC_CHECK_LIB([avcodec], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
|
||||||
dnl Check for avcodec_find_best_pix_fmt_of_list (is only in ffmpeg, not libav)
|
dnl Check for avcodec_find_best_pix_fmt_of_list (is only in ffmpeg, not libav)
|
||||||
AC_CHECK_LIB([avcodec], [avcodec_find_best_pix_fmt_of_list],
|
AC_CHECK_LIB([avcodec], [avcodec_find_best_pix_fmt_of_list],
|
||||||
AC_DEFINE(FFMPEG_INCOMPATIBLE_API, 1, [Define to 1 if you have ffmpeg (and not libav).]))
|
AC_DEFINE(HAVE_FFMPEG, 1, [Define to 1 if you have ffmpeg (and not libav).]))
|
||||||
LIBS="$save_LIBS"
|
LIBS="$save_LIBS"
|
||||||
|
|
||||||
# Check for libavformat >= 53; url -> avio switch
|
# Check for libavformat >= 53; url -> avio switch
|
||||||
|
@ -314,7 +314,7 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, struct ev
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35)
|
#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35)
|
||||||
# ifndef FFMPEG_INCOMPATIBLE_API
|
# ifndef HAVE_FFMPEG
|
||||||
dst->pix_fmt = avcodec_find_best_pix_fmt2((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
dst->pix_fmt = avcodec_find_best_pix_fmt2((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
||||||
# else
|
# else
|
||||||
dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
||||||
|
@ -415,6 +415,15 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
|
|||||||
options = NULL;
|
options = NULL;
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_MAJOR >= 54 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR >= 3)
|
#if LIBAVFORMAT_VERSION_MAJOR >= 54 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR >= 3)
|
||||||
|
# ifndef HAVE_FFMPEG
|
||||||
|
// Without this, libav is slow to probe some internet streams
|
||||||
|
if (mfi->data_kind == 1)
|
||||||
|
{
|
||||||
|
ctx = avformat_alloc_context();
|
||||||
|
ctx->probesize = 64000;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (mfi->data_kind == 1)
|
if (mfi->data_kind == 1)
|
||||||
av_dict_set(&options, "icy", "1", 0);
|
av_dict_set(&options, "icy", "1", 0);
|
||||||
|
|
||||||
|
@ -498,6 +498,15 @@ transcode_setup(struct transcode_ctx **nctx, struct media_file_info *mfi, off_t
|
|||||||
memset(ctx, 0, sizeof(struct transcode_ctx));
|
memset(ctx, 0, sizeof(struct transcode_ctx));
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_MAJOR >= 54 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR >= 3)
|
#if LIBAVFORMAT_VERSION_MAJOR >= 54 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR >= 3)
|
||||||
|
# ifndef HAVE_FFMPEG
|
||||||
|
// Without this, libav is slow to probe some internet streams, which leads to RAOP timeouts
|
||||||
|
if (mfi->data_kind == 1)
|
||||||
|
{
|
||||||
|
ctx->fmtctx = avformat_alloc_context();
|
||||||
|
ctx->fmtctx->probesize = 64000;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
ret = avformat_open_input(&ctx->fmtctx, mfi->path, NULL, NULL);
|
ret = avformat_open_input(&ctx->fmtctx, mfi->path, NULL, NULL);
|
||||||
#else
|
#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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user