aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2024-09-08 22:21:03 +0200
committerMarvin Scholz <epirat07@gmail.com>2024-09-13 19:38:40 +0200
commit3ebc68d25de102434a7e64c5b4d8b9c69c5bf165 (patch)
tree8ee8d469b72ad465a1d864923438d23e89ed6075
parent25f0fff9ec552b8e7752262673392175595b827b (diff)
downloadffmpeg-3ebc68d25de102434a7e64c5b4d8b9c69c5bf165.tar.gz
fftools/ffmpeg_mux_init: fix variable shadowing
-rw-r--r--fftools/ffmpeg_mux_init.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 6d9029c9c3..30d74d37bd 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -673,11 +673,9 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o,
}
opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix);
if (chroma_intra_matrix) {
- uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64);
- if (!p)
+ if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)))
return AVERROR(ENOMEM);
- video_enc->chroma_intra_matrix = p;
- ret = parse_matrix_coeffs(ost, p, chroma_intra_matrix);
+ ret = parse_matrix_coeffs(ost, video_enc->chroma_intra_matrix, chroma_intra_matrix);
if (ret < 0)
return ret;
}
@@ -740,8 +738,8 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o,
FILE *f;
/* compute this stream's global index */
- for (int i = 0; i <= ost->file->index; i++)
- ost_idx += output_files[i]->nb_streams;
+ for (int idx = 0; idx <= ost->file->index; idx++)
+ ost_idx += output_files[idx]->nb_streams;
snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
ost->logfile_prefix ? ost->logfile_prefix :
@@ -1263,21 +1261,20 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
return AVERROR(ENOMEM);
if (ost->enc_ctx) {
- AVCodecContext *enc = ost->enc_ctx;
AVIOContext *s = NULL;
char *buf = NULL, *arg = NULL;
const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL;
const char *enc_time_base = NULL, *preset = NULL;
- ret = filter_codec_opts(o->g->codec_opts, enc->codec_id,
- oc, st, enc->codec, &encoder_opts,
+ ret = filter_codec_opts(o->g->codec_opts, ost->enc_ctx->codec_id,
+ oc, st, ost->enc_ctx->codec, &encoder_opts,
&mux->enc_opts_used);
if (ret < 0)
goto fail;
opt_match_per_stream_str(ost, &o->presets, oc, st, &preset);
opt_match_per_stream_int(ost, &o->autoscale, oc, st, &autoscale);
- if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s)))) {
+ if (preset && (!(ret = get_preset_file_2(preset, ost->enc_ctx->codec->name, &s)))) {
AVBPrint bprint;
av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED);
do {