[configure] Use avcodec_parameters_from_context as check for codecpar

This commit is contained in:
ejurgensen 2017-03-05 10:05:21 +01:00
parent 6b94a34501
commit e489f1a6a9
2 changed files with 3 additions and 5 deletions

View File

@ -250,7 +250,6 @@ FORK_MODULES_CHECK([FORKED], [LIBAV],
[libavfilter/avfilter.h])
FORK_CHECK_DECLS([av_packet_unref], [libavcodec/avcodec.h])
FORK_CHECK_DECLS([av_packet_rescale_ts], [libavcodec/avcodec.h])
FORK_CHECK_DECLS([avcodec_parameters_alloc], [libavcodec/avcodec.h])
FORK_CHECK_DECLS([avformat_alloc_output_context2],
[libavformat/avformat.h])
FORK_CHECK_DECLS([av_frame_alloc], [libavutil/frame.h])
@ -261,7 +260,6 @@ FORK_MODULES_CHECK([FORKED], [LIBAV],
AC_CHECK_HEADERS([libavutil/channel_layout.h libavutil/mathematics.h])
])
])
AM_CONDITIONAL([COND_FFMPEG_LEGACY], [[test "x$modern_av_apis" = "xno"]])
AC_CHECK_SIZEOF([void *])

View File

@ -370,11 +370,11 @@ scan_metadata_ffmpeg(const char *file, struct media_file_info *mfi)
if (mfi->data_kind == DATA_KIND_HTTP)
{
# ifndef HAVE_FFMPEG
#ifndef HAVE_FFMPEG
// Without this, libav is slow to probe some internet streams
ctx = avformat_alloc_context();
ctx->probesize = 64000;
# endif
#endif
free(path);
ret = http_stream_setup(&path, file);
@ -425,7 +425,7 @@ scan_metadata_ffmpeg(const char *file, struct media_file_info *mfi)
for (i = 0; i < ctx->nb_streams; i++)
{
#if HAVE_DECL_AVCODEC_PARAMETERS_ALLOC
#if HAVE_DECL_AVCODEC_PARAMETERS_FROM_CONTEXT
codec_type = ctx->streams[i]->codecpar->codec_type;
codec_id = ctx->streams[i]->codecpar->codec_id;
sample_rate = ctx->streams[i]->codecpar->sample_rate;