aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-08-25 10:01:19 +0200
committerAnton Khirnov <anton@khirnov.net>2022-08-29 15:42:11 +0200
commitd0f767f81f7b6c4e9a3d29a9fd622ab519461213 (patch)
treed24755835a37fe98c87cf1b9a4cc5ca6c0d86c5c /fftools/ffmpeg_filter.c
parent4a4a206304e1d168e9a839d1a9c426e459343322 (diff)
downloadffmpeg-d0f767f81f7b6c4e9a3d29a9fd622ab519461213.tar.gz
fftools/ffmpeg: drop OutputStream.enc
It is either equal to OutputStream.enc_ctx->codec, or NULL when enc_ctx is NULL. Replace the use of enc with enc_ctx->codec, or the equivalent enc_ctx->codec_* fields where more convenient.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index e9479018e4..ac8d81c8aa 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -90,6 +90,7 @@ choose_pixel_fmt(const AVCodec *codec, enum AVPixelFormat target,
static const char *choose_pix_fmts(OutputFilter *ofilter, AVBPrint *bprint)
{
OutputStream *ost = ofilter->ost;
+ AVCodecContext *enc = ost->enc_ctx;
const AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0);
if (strict_dict)
// used by choose_pixel_fmt() and below
@@ -103,14 +104,14 @@ static const char *choose_pix_fmts(OutputFilter *ofilter, AVBPrint *bprint)
return av_get_pix_fmt_name(ost->enc_ctx->pix_fmt);
}
if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) {
- return av_get_pix_fmt_name(choose_pixel_fmt(ost->enc, ost->enc_ctx->pix_fmt,
+ return av_get_pix_fmt_name(choose_pixel_fmt(enc->codec, enc->pix_fmt,
ost->enc_ctx->strict_std_compliance));
- } else if (ost->enc->pix_fmts) {
+ } else if (enc->codec->pix_fmts) {
const enum AVPixelFormat *p;
- p = ost->enc->pix_fmts;
+ p = enc->codec->pix_fmts;
if (ost->enc_ctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
- p = get_compliance_normal_pix_fmts(ost->enc, p);
+ p = get_compliance_normal_pix_fmts(enc->codec, p);
}
for (; *p != AV_PIX_FMT_NONE; p++) {
@@ -1095,8 +1096,8 @@ int configure_filtergraph(FilterGraph *fg)
for (i = 0; i < fg->nb_outputs; i++) {
OutputStream *ost = fg->outputs[i]->ost;
- if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
- !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
+ if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO &&
+ !(ost->enc_ctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
av_buffersink_set_frame_size(ost->filter->filter,
ost->enc_ctx->frame_size);
}