diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-25 05:02:39 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-02 08:20:10 +0100 |
commit | 988deae6da70e3c24d8e75d75e300e49981599b7 (patch) | |
tree | 3df96584ffa6bab6affaa61132ec83d2dff53068 /fftools/ffmpeg.c | |
parent | c17915fd64f7e5d138820681c58c84b047336f13 (diff) | |
download | ffmpeg-988deae6da70e3c24d8e75d75e300e49981599b7.tar.gz |
fftools: Switch to const AVCodec * where possible
The obstacle to do so was in filter_codec_opts: It uses searches
the AVCodec for options via the AV_OPT_SEARCH_FAKE_OBJ method, which
requires using a void * that points to a pointer to a const AVClass.
When using const AVCodec *, one can not simply use a pointer that points
to the AVCodec's pointer to its AVClass, as said pointer is const, too.
This is fixed by using a temporary pointer to the AVClass.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r-- | fftools/ffmpeg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index abf35150bd..2abbc0ff29 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -688,7 +688,7 @@ void assert_avoptions(AVDictionary *m) } } -static void abort_codec_experimental(AVCodec *c, int encoder) +static void abort_codec_experimental(const AVCodec *c, int encoder) { exit_program(1); } @@ -2943,7 +2943,7 @@ static int init_input_stream(int ist_index, char *error, int error_len) InputStream *ist = input_streams[ist_index]; if (ist->decoding_needed) { - AVCodec *codec = ist->dec; + const AVCodec *codec = ist->dec; if (!codec) { snprintf(error, error_len, "Decoder (codec %s) not found for input stream #%d:%d", avcodec_get_name(ist->dec_ctx->codec_id), ist->file_index, ist->st->index); @@ -3522,7 +3522,7 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, int ret = 0; if (ost->encoding_needed) { - AVCodec *codec = ost->enc; + const AVCodec *codec = ost->enc; AVCodecContext *dec = NULL; InputStream *ist; |