mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-16 17:10:03 -04:00
libav 0.7: Replace CODEC_TYPE_* with AVMEDIA_TYPE_*
This commit is contained in:
parent
d8685846d0
commit
b203f1ea1f
@ -216,13 +216,21 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma
|
|||||||
|
|
||||||
dst = dst_st->codec;
|
dst = dst_st->codec;
|
||||||
|
|
||||||
|
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 64)
|
||||||
|
avcodec_get_context_defaults2(dst, AVMEDIA_TYPE_VIDEO);
|
||||||
|
#else
|
||||||
avcodec_get_context_defaults2(dst, CODEC_TYPE_VIDEO);
|
avcodec_get_context_defaults2(dst, CODEC_TYPE_VIDEO);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dst_fmt->flags & AVFMT_GLOBALHEADER)
|
if (dst_fmt->flags & AVFMT_GLOBALHEADER)
|
||||||
dst->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
dst->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||||
|
|
||||||
dst->codec_id = dst_fmt->video_codec;
|
dst->codec_id = dst_fmt->video_codec;
|
||||||
|
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 64)
|
||||||
|
dst->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
|
#else
|
||||||
dst->codec_type = CODEC_TYPE_VIDEO;
|
dst->codec_type = CODEC_TYPE_VIDEO;
|
||||||
|
#endif
|
||||||
|
|
||||||
pix_fmt_mask = 0;
|
pix_fmt_mask = 0;
|
||||||
pix_fmts = img_encoder->pix_fmts;
|
pix_fmts = img_encoder->pix_fmts;
|
||||||
|
@ -344,7 +344,11 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
|
|||||||
{
|
{
|
||||||
switch (ctx->streams[i]->codec->codec_type)
|
switch (ctx->streams[i]->codec->codec_type)
|
||||||
{
|
{
|
||||||
|
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 64)
|
||||||
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
|
#else
|
||||||
case CODEC_TYPE_VIDEO:
|
case CODEC_TYPE_VIDEO:
|
||||||
|
#endif
|
||||||
if (!video_stream)
|
if (!video_stream)
|
||||||
{
|
{
|
||||||
DPRINTF(E_DBG, L_SCAN, "File has video (stream %d)\n", i);
|
DPRINTF(E_DBG, L_SCAN, "File has video (stream %d)\n", i);
|
||||||
@ -355,7 +359,11 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 64)
|
||||||
|
case AVMEDIA_TYPE_AUDIO:
|
||||||
|
#else
|
||||||
case CODEC_TYPE_AUDIO:
|
case CODEC_TYPE_AUDIO:
|
||||||
|
#endif
|
||||||
if (!audio_stream)
|
if (!audio_stream)
|
||||||
{
|
{
|
||||||
audio_stream = ctx->streams[i];
|
audio_stream = ctx->streams[i];
|
||||||
|
@ -365,7 +365,11 @@ transcode_setup(struct media_file_info *mfi, off_t *est_size, int wavhdr)
|
|||||||
ctx->astream = -1;
|
ctx->astream = -1;
|
||||||
for (i = 0; i < ctx->fmtctx->nb_streams; i++)
|
for (i = 0; i < ctx->fmtctx->nb_streams; i++)
|
||||||
{
|
{
|
||||||
|
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 64)
|
||||||
|
if (ctx->fmtctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||||
|
#else
|
||||||
if (ctx->fmtctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
|
if (ctx->fmtctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
ctx->astream = i;
|
ctx->astream = i;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user