summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-05-01 21:53:56 +0200
committersfan5 <sfan5@live.de>2021-05-01 22:07:31 +0200
commit39630dc8b6c2241df9e0e6066e1bd858b864f7de (patch)
tree47e41a747f0597b9b3c0d061bef9c3051597684d /common
parent02fbdf8aaffac527ce33c81ace001b48aee9e953 (diff)
downloadmpv-39630dc8b6c2241df9e0e6066e1bd858b864f7de.tar.bz2
mpv-39630dc8b6c2241df9e0e6066e1bd858b864f7de.tar.xz
build: address AVCodec, AVInputFormat, AVOutputFormat const warnings
FFmpeg recently changed these to be const on their side.
Diffstat (limited to 'common')
-rw-r--r--common/av_common.c4
-rw-r--r--common/encode_lavc.c6
-rw-r--r--common/encode_lavc.h4
3 files changed, 7 insertions, 7 deletions
diff --git a/common/av_common.c b/common/av_common.c
index 01428ff2f4..2eae8c4e3e 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -270,7 +270,7 @@ int mp_codec_to_av_codec_id(const char *codec)
if (desc)
id = desc->id;
if (id == AV_CODEC_ID_NONE) {
- AVCodec *avcodec = avcodec_find_decoder_by_name(codec);
+ const AVCodec *avcodec = avcodec_find_decoder_by_name(codec);
if (avcodec)
id = avcodec->id;
}
@@ -285,7 +285,7 @@ const char *mp_codec_from_av_codec_id(int codec_id)
if (desc)
name = desc->name;
if (!name) {
- AVCodec *avcodec = avcodec_find_decoder(codec_id);
+ const AVCodec *avcodec = avcodec_find_decoder(codec_id);
if (avcodec)
name = avcodec->name;
}
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index 2af93d239f..cf033e07d5 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -735,7 +735,7 @@ static void encoder_destroy(void *ptr)
free_stream(p->twopass_bytebuffer);
}
-static AVCodec *find_codec_for(struct encode_lavc_context *ctx,
+static const AVCodec *find_codec_for(struct encode_lavc_context *ctx,
enum stream_type type, bool *used_auto)
{
char *codec_name = type == STREAM_VIDEO
@@ -746,7 +746,7 @@ static AVCodec *find_codec_for(struct encode_lavc_context *ctx,
*used_auto = !(codec_name && codec_name[0]);
- AVCodec *codec;
+ const AVCodec *codec;
if (*used_auto) {
codec = avcodec_find_encoder(av_guess_codec(ctx->oformat, NULL,
ctx->options->file, NULL,
@@ -797,7 +797,7 @@ struct encoder_context *encoder_context_alloc(struct encode_lavc_context *ctx,
};
bool auto_codec;
- AVCodec *codec = find_codec_for(ctx, type, &auto_codec);
+ const AVCodec *codec = find_codec_for(ctx, type, &auto_codec);
const char *tname = stream_type_name(type);
if (!codec) {
diff --git a/common/encode_lavc.h b/common/encode_lavc.h
index 06e7254e86..cc4030a292 100644
--- a/common/encode_lavc.h
+++ b/common/encode_lavc.h
@@ -41,7 +41,7 @@ struct encode_lavc_context {
struct encode_opts *options;
struct mp_log *log;
struct encode_priv *priv;
- AVOutputFormat *oformat;
+ const AVOutputFormat *oformat;
const char *filename;
// All entry points must be guarded with the lock. Functions called by
@@ -71,7 +71,7 @@ struct encoder_context {
struct mpv_global *global;
struct encode_opts *options;
struct mp_log *log;
- AVOutputFormat *oformat;
+ const AVOutputFormat *oformat;
// (avoid using this)
struct encode_lavc_context *encode_lavc_ctx;